Hogan1996 Posted September 9, 2019 Share Posted September 9, 2019 I am starting a new server for MTA and need a little help with scripting, if you are able to help me out with any questions I may need to ask please add my discord "FrankHogan#2619" I am working on a script now for spawn points here is the code local spawnX, spawnY, spawnZ = 1769.55469, -1862.20325, 13.57658 function joinhandler () spawnPlayer (source, spawnX, spawnY, spawnZ) fadecamera (source, true) setcameratarget (source, spawnX, spawnY, spawnZ) outputchatbox ("Welcome to Los Angeles Roleplay", source) end addEventHandler ("onPlayerjoin", getRootElement (), joinhandler) Problem I have having when I start the script it doesn't spawn at XYZ. When I kill myself I don't respawn either I just keep floating in the death screen. Link to comment
Scripting Moderators ds1-e Posted September 9, 2019 Scripting Moderators Share Posted September 9, 2019 14 minutes ago, Hogan1996 said: I am starting a new server for MTA and need a little help with scripting, if you are able to help me out with any questions I may need to ask please add my discord "FrankHogan#2619" I am working on a script now for spawn points here is the code local spawnX, spawnY, spawnZ = 1769.55469, -1862.20325, 13.57658 function joinhandler () spawnPlayer (source, spawnX, spawnY, spawnZ) fadecamera (source, true) setcameratarget (source, spawnX, spawnY, spawnZ) outputchatbox ("Welcome to Los Angeles Roleplay", source) end addEventHandler ("onPlayerjoin", getRootElement (), joinhandler) Problem I have having when I start the script it doesn't spawn at XYZ. When I kill myself I don't respawn either I just keep floating in the death screen. Next time use this: To show your code, it will help in readability for others. About problem, i doubt that you check /debugscript 3 for errors/warnings, without debug you couldn't go any further, trust me. Lua is case sensitive Fixed code: local spawnX, spawnY, spawnZ = 1769.55469, -1862.20325, 13.57658 function joinHandler() spawnPlayer(source, spawnX, spawnY, spawnZ) fadeCamera(source, true) -- case sensitive setCameraTarget(source) -- case sensitive + there's no such arguments like x, y, z outputChatBox("Welcome to Los Angeles Roleplay", source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) 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