Jump to content

Need help, script error.


Recommended Posts

    addEventHandler ("onClientMouseEnter", root, function(aX, aY) 
    if spawn then -- checks if the mouse is on the button called *spawn* 
        sound = playSound("sounds/Enter.mp3") 
        setSoundVolume(sound, 1.0) 
    end 
end) 

I tried putting sound, when player approach their mouth on the button, but it didn't work, no bugs, sound added in meta.xml, as well.

Link to comment

Try this it should work

addEventHandler("onClientMouseEnter", guiRoot, 
    function(aX, aY) 
        if source == spawn then  
        local sound = playSound("sounds/Enter.mp3") 
        setSoundVolume(sound, 1.0) 
    end 
end) 

Link to comment
Try this it should work
addEventHandler("onClientMouseEnter", guiRoot, 
    function(aX, aY) 
        if source == spawn then  
        local sound = playSound("sounds/Enter.mp3") 
        setSoundVolume(sound, 1.0) 
    end 
end) 

Bad 'sound/player' pointer @ 'setSoundVolume'(1) 

Link to comment
just check the element before using the specific function.

Tried it, this time no error, but still no sound:

    addEventHandler("onClientMouseEnter", guiRoot, 
        function(aX, aY) 
            if source == spawn then 
            local sound = playSound("sounds/Enter.mp3") 
            if sound then 
            setSoundVolume(sound, 1.0) 
        end 
    end 
end) 

Link to comment
just check the element before using the specific function.

Tried it, this time no error, but still no sound:

    addEventHandler("onClientMouseEnter", guiRoot, 
        function(aX, aY) 
            if source == spawn then 
            local sound = playSound("sounds/Enter.mp3") 
            if sound then 
            setSoundVolume(sound, 1.0) 
        end 
    end 
end) 

Anything? :/

Link to comment

there is nothing wrong

try to use sth like this

addEventHandler("onClientMouseEnter", guiRoot, 
function() 
    if (getElementType(source) == "gui-button") then 
        playSound("sounds/Enter.mp3", false) 
    end 
end 
) 

Link to comment
there is nothing wrong

try to use sth like this

addEventHandler("onClientMouseEnter", guiRoot, 
function() 
    if (getElementType(source) == "gui-button") then 
        playSound("sounds/Enter.mp3", false) 
    end 
end 
) 

I am totally confused... tried it, doesn't work.


I am confused....

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...