Jump to content

Bad argument @ 'bindkey'


Recommended Posts

Estou tendo problemas com um script, quando uso ele simplesmente aparece "Bad argument @ 'bindkey' [Expected player at argument 1, got nil] , eis ai o script

function startMusic()
    setRadioChannel(0)
    song = playSound("musica.mp3",true)
    outputChatBox("Para ativar/desativar a música pressione m", 255, 0, 0, true )
end

function toggleSong()
    if not songOff then
        setSoundVolume(song,0)
        songOff = true
        removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff)
    else
        setSoundVolume(song,1)
        songOff = false
        setRadioChannel(0)
        addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff)
    end
end

addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic)
addCommandHandler("music",toggleSong)
bindKey(player,"m","down","music")

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...