TheScriptingNewbie Posted February 19, 2013 Share Posted February 19, 2013 Hello, i know i am very stupid and new at scripting, but i have a problem. I have a script, when player types /spawn command he will spawn at specifed co-ordinates, for some reason when i type the command, nothing happens.I am very new in LUA scripting and my scripts are probbably a mess, so please dont flame on me. Here is my script: (i know i completely messed up), i hope to get friendly support from people, just as i got on my first thread. function spawn(cmd) if cmd == "spawn" then spawnplayer(source, 1959.55, -1714.46, 10) addEventHandler(getRootElement ( )) end end Link to comment
ali Posted February 19, 2013 Share Posted February 19, 2013 function spawns(player) spawnPlayer(player, 1959.55, -1714.46, 10) end addCommandHandler("spawn", spawns) Link to comment
TheScriptingNewbie Posted February 19, 2013 Author Share Posted February 19, 2013 Thank you, i have another question, i have a script and when i type in /anim into chat the animation plays, how do i make the animation stop? Link to comment
iPrestege Posted February 19, 2013 Share Posted February 19, 2013 (edited) Thank you, i have another question, i have a script and when i type in /anim into chat the animation plays, how do i make the animation stop? addEventHandler("onPlayerChat",root, function (msg,ped) if ( msg == "anim" ) then setPedAnimation(ped,nil,nil,nil) end end ) Edited February 19, 2013 by Guest Link to comment
Castillo Posted February 19, 2013 Share Posted February 19, 2013 "ped" isn't defined. Link to comment
iPrestege Posted February 19, 2013 Share Posted February 19, 2013 "ped" isn't defined. I forgot this Sorry I've modified it now. Link to comment
TheScriptingNewbie Posted February 19, 2013 Author Share Posted February 19, 2013 Hmm, i might do something wrong, but when i type /anim again, nothing happens. 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