BorderLine Posted September 28, 2012 Share Posted September 28, 2012 hi everyone. Well i have a problem and i dont know why i have this function zomb(cplayer) x,y,z = getElementPosition(cplayer) exports [ "slothBot" ]:spawnBot ( x,y,z, 0, 10, 0, 0, Zombies, 0, "hunting", true ) end addEventHandler ( "onPlayerSpawn", getRootElement(), zomb) The problem is, error in argument of getElementPosition. say nill argument. I try many ways but doesnt work. Thanks for your time Link to comment
Vision Posted September 29, 2012 Share Posted September 29, 2012 Try this function zomb() local x, y, z = getElementPosition(source) exports [ "slothBot" ]:spawnBot ( x, y, z, 0, 10, 0, 0, Zombies, 0, "hunting", true ) end addEventHandler ( "onPlayerSpawn", getRootElement(), zomb) Link to comment
BorderLine Posted September 29, 2012 Author Share Posted September 29, 2012 i did too, but still same error Link to comment
Vision Posted September 29, 2012 Share Posted September 29, 2012 Really? Worked fine for me Link to comment
TAPL Posted September 29, 2012 Share Posted September 29, 2012 function zomb(posX, posY, posZ) exports["slothBot"]:spawnBot(posX, posY, posZ, 0, 10, 0, 0, Zombies, 0, "hunting", true) -- Zombies is defined? it should be a team element. end addEventHandler("onPlayerSpawn", root, zomb) 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