Lua
function JoinSound( thePlayer )
local theAccount = getPlayerAccount( thePlayer )
if getAccountName( theAccount ) == "#ZERO" then
setTimer(playSound,500,1,"marwin.mp3")
elseif getAccountName( theAccount ) == "Blunt" then
setTimer(playSound,500,1,"leon.mp3")
elseif getAccountName( theAccount ) == "Dutch" then
setTimer(playSound,500,1,"jacki.mp3")
end
end
addEventHandler("onPlayerLogin",getRootElement(),JoinSound)
-----------------------
--Copyright by @#ZERO--
-----------------------
function testJoinSoundWithCommand(player , cmd )
setTimer(playWinSound ,500,1)
local spieler = getPlayerName( player )
outputChatBox("#FFFFFF[Info] "..spieler.."#00FF00 is very super famous!",getRootElement(),255,255,255,true)
end
addCommandHandler("win",testJoinSoundWithCommand)
function playWinSound()
local URL = "http://pbehrens.bplaced.net/marwin.mp3"
local winSound = playSound( URL )
setSoundVolume( winSound , 1 )
end
Alles anzeigen
Hallo. Ich wollte einen Joinsound , bzw. /win Command machen , wobei ein Sound abgespielt wird, doch immer wenn ich /win benutze kommt im Debugscript: ERROR: JoinSound/JoinSound.lua:26: attempt to call global 'playSound' ( a nil value )