Dadcdai Posted December 7, 2022 Share Posted December 7, 2022 Hey i tryed so hard to change the spawn location when you (Create) ur character, but whenere i change somthing in it, it wont work or it gives me erros, can someone tell me how to change the location when you (Create) ur character? Here this is the code: local locationToSpawn = {} if location then -- if this is not a newly created character spawn, location would be nil /maxime --outputDebugString("this is a newly created character spawn.") locationToSpawn.x = location[1] locationToSpawn.y = location[2] locationToSpawn.z = location[3] locationToSpawn.rot = location[4] locationToSpawn.int = location[5] locationToSpawn.dim = location[6] else --Otherwise, spawn normally for old characters. Fetch location from database. /maxime locationToSpawn.x = tonumber(characterData["x"]) locationToSpawn.y = tonumber(characterData["y"]) locationToSpawn.z = tonumber(characterData["z"]) locationToSpawn.rot = tonumber(characterData["rotation"]) locationToSpawn.int = tonumber(characterData["interior_id"]) locationToSpawn.dim = tonumber(characterData["dimension_id"]) end spawnPlayer(client, locationToSpawn.x ,locationToSpawn.y ,locationToSpawn.z , locationToSpawn.rot, tonumber(characterData["skin"])) setElementDimension(client, locationToSpawn.dim) setElementInterior(client, locationToSpawn.int , locationToSpawn.x, locationToSpawn.y, locationToSpawn.z) setCameraInterior(client, locationToSpawn.int) Link to comment
Vampire Posted December 7, 2022 Share Posted December 7, 2022 Hello @Dadcdai and welcome! I've moved your topic to the Scripting section so you can get better assistance. Link to comment
mafioz Posted December 7, 2022 Share Posted December 7, 2022 It would be nice if you posted the whole function and as code instead of text Link to comment
Dadcdai Posted December 7, 2022 Author Share Posted December 7, 2022 How? local locationToSpawn = {} if location then -- if this is not a newly created character spawn, location would be nil /maxime --outputDebugString("this is a newly created character spawn.") locationToSpawn.x = location[1] locationToSpawn.y = location[2] locationToSpawn.z = location[3] locationToSpawn.rot = location[4] locationToSpawn.int = location[5] locationToSpawn.dim = location[6] else --Otherwise, spawn normally for old characters. Fetch location from database. /maxime locationToSpawn.x = tonumber(characterData["x"]) locationToSpawn.y = tonumber(characterData["y"]) locationToSpawn.z = tonumber(characterData["z"]) locationToSpawn.rot = tonumber(characterData["rotation"]) locationToSpawn.int = tonumber(characterData["interior_id"]) locationToSpawn.dim = tonumber(characterData["dimension_id"]) end spawnPlayer(client, -203.65929 ,1119.41309 ,19.74219 , 0, tonumber(characterData["skin"])) setElementDimension(client, 0) setElementInterior(client, 0 , 0, 0, 0) setCameraInterior(client, 0) local locationToSpawn = {} if location then -- if this is not a newly created character spawn, location would be nil /maxime --outputDebugString("this is a newly created character spawn.") locationToSpawn.x = location[1] locationToSpawn.y = location[2] locationToSpawn.z = location[3] locationToSpawn.rot = location[4] locationToSpawn.int = location[5] locationToSpawn.dim = location[6] else --Otherwise, spawn normally for old characters. Fetch location from database. /maxime locationToSpawn.x = tonumber(characterData["x"]) locationToSpawn.y = tonumber(characterData["y"]) locationToSpawn.z = tonumber(characterData["z"]) locationToSpawn.rot = tonumber(characterData["rotation"]) locationToSpawn.int = tonumber(characterData["interior_id"]) locationToSpawn.dim = tonumber(characterData["dimension_id"]) end spawnPlayer(client, -203.65929 ,1119.41309 ,19.74219 , 0, tonumber(characterData["skin"])) setElementDimension(client, 0) setElementInterior(client, 0 , 0, 0, 0) setCameraInterior(client, 0) here it is: local locationToSpawn = {} if location then -- if this is not a newly created character spawn, location would be nil /maxime --outputDebugString("this is a newly created character spawn.") locationToSpawn.x = location[1] locationToSpawn.y = location[2] locationToSpawn.z = location[3] locationToSpawn.rot = location[4] locationToSpawn.int = location[5] locationToSpawn.dim = location[6] else --Otherwise, spawn normally for old characters. Fetch location from database. /maxime locationToSpawn.x = tonumber(characterData["x"]) locationToSpawn.y = tonumber(characterData["y"]) locationToSpawn.z = tonumber(characterData["z"]) locationToSpawn.rot = tonumber(characterData["rotation"]) locationToSpawn.int = tonumber(characterData["interior_id"]) locationToSpawn.dim = tonumber(characterData["dimension_id"]) end spawnPlayer(client, -203.65929 ,1119.41309 ,19.74219 , 0, tonumber(characterData["skin"])) setElementDimension(client, 0) setElementInterior(client, 0 , 0, 0, 0) setCameraInterior(client, 0) 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