AJXB Posted April 5, 2014 Share Posted April 5, 2014 Main function and a sub function works on timer, what's the problem? function test () local curAcc = getPlayerAccount(source) setAccountData(curAcc,"Test",true) setTimer ( function () spawnPlayer(source,1186, -1323, 14 + 0.5,0,skin) setElementHealth (source,100) end,7500,1) end Bad argument for spawnPlayer and setElementHealth, expected element Link to comment
Weii. Posted April 5, 2014 Share Posted April 5, 2014 function test () local curAcc = getPlayerAccount(source) setAccountData(curAcc,"Test",true) setTimer ( function (player) spawnPlayer(player,1186, -1323, 14 + 0.5,0,skin) setElementHealth (player,100) end,7500,1, source) end Link to comment
iPrestege Posted April 5, 2014 Share Posted April 5, 2014 Main function and a sub function works on timer, what's the problem? function test () local curAcc = getPlayerAccount(source) setAccountData(curAcc,"Test",true) setTimer ( function () spawnPlayer(source,1186, -1323, 14 + 0.5,0,skin) setElementHealth (source,100) end,7500,1) end Bad argument for spawnPlayer and setElementHealth, expected element You're calling this function via what? 'Event - Command - Handler?' Link to comment
AJXB Posted April 5, 2014 Author Share Posted April 5, 2014 Main function and a sub function works on timer, what's the problem? function test () local curAcc = getPlayerAccount(source) setAccountData(curAcc,"Test",true) setTimer ( function () spawnPlayer(source,1186, -1323, 14 + 0.5,0,skin) setElementHealth (source,100) end,7500,1) end Bad argument for spawnPlayer and setElementHealth, expected element You're calling this function via what? 'Event - Command - Handler?' addEventHandler("onPlayerWasted",root,test) Link to comment
iPrestege Posted April 5, 2014 Share Posted April 5, 2014 function test ( ) local curAcc = getPlayerAccount(source) if isGuestAccount ( curAcc ) then return false end setAccountData(curAcc,"Test",true) setTimer ( function ( source ) spawnPlayer(source,1186, -1323, 14 + 0.5,0,skin) setElementHealth (source,100) end,7500,1,source) end P.S : Is skin defined in the spawnPlayer func? Link to comment
AJXB Posted April 5, 2014 Author Share Posted April 5, 2014 function test ( ) local curAcc = getPlayerAccount(source) if isGuestAccount ( curAcc ) then return false end setAccountData(curAcc,"Test",true) setTimer ( function ( source ) spawnPlayer(source,1186, -1323, 14 + 0.5,0,skin) setElementHealth (source,100) end,7500,1,source) end P.S : Is skin defined in the spawnPlayer func? Yeah it its, thanks! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now