th3cross3r Posted September 1, 2011 Share Posted September 1, 2011 Hey Community, i have one question. I wanna change the standart spawn point to another spawn point. Iam a noob in scripting... but where i can change it easily? greetings, Philipp Link to comment
Castillo Posted September 1, 2011 Share Posted September 1, 2011 Of what gamemode are you talking about? Link to comment
NotAvailable Posted September 1, 2011 Share Posted September 1, 2011 You have to change the coordinates in the script. If it's Play, open -> Broph.lua Link to comment
th3cross3r Posted September 1, 2011 Author Share Posted September 1, 2011 Sorry... i forgot.. its Play @Jesseunit Ok thanks first... i will look and test my best! UPDATE: Ok sorry... i dont know what to do! My broph.lua data: addEventHandler("onResourceStart", resourceRoot, function() resetMapInfo() for i,player in ipairs(getElementsByType("player")) do spawn(player) end end ) function spawn(player) if not isElement(player) then return end repeat until spawnPlayer ( player, -711+math.random(1,5), 957+math.random(5,9), 12.4, 90, math.random(312), 0, 0) fadeCamera(player, true) setCameraTarget(player, player) showChat(player, true) end addEventHandler("onPlayerJoin", root, function() spawn(source) end ) addEventHandler("onPlayerWasted", root, function() setTimer(spawn, 1800, 1, source) end ) Link to comment
Axel Posted September 1, 2011 Share Posted September 1, 2011 You have to change here repeat until spawnPlayer ( player, x+math.random(1,5), y+math.random(5,9), z, 90, math.random(312), 0, 0) x,y,z / coordonates Link to comment
th3cross3r Posted September 1, 2011 Author Share Posted September 1, 2011 Ah know i know it how i make a new spawn point... its really easy... thank you... thank you all!! Did you know one mod/script to see players on minimap? Link to comment
CapY Posted September 1, 2011 Share Posted September 1, 2011 By the way , is it possible to have spawn at 3 places and everytime when player joins he is spawned on other place. So is it ? Link to comment
Castillo Posted September 1, 2011 Share Posted September 1, 2011 Do you mean like a random location? if so, yes, you can make a table with locations and then use math.random. Link to comment
CapY Posted September 1, 2011 Share Posted September 1, 2011 (edited) I rather will use elseif than math . Edited September 1, 2011 by Guest Link to comment
th3cross3r Posted September 1, 2011 Author Share Posted September 1, 2011 When i die, i spawn at the Hospital... and a new registered user in the near of the police apartment... why?!??! pls help Link to comment
CapY Posted September 2, 2011 Share Posted September 2, 2011 So.. this is doesnt works . addEventHandler("onResourceStart", resourceRoot, function() resetMapInfo() for i,player in ipairs(getElementsByType("player")) do spawn(player) end end ) function spawn(player) if not isElement(player) then return end repeat until spawnPlayer ( player, -711+math.random(1,5), 957+math.random(5,9), 12.4, 90, math.random(9,288), 0, 0) fadeCamera(player, true) setCameraTarget(player, player) showChat(player, true) end addEventHandler("onPlayerJoin", root, function() local x = -1656 local y = -425 local z = 15 elseif local x = 1327 local y = 1537 local z = 15 spawnPlayer(source, x, y, z) fadeCamera(source, true) setCameraTarget(source, source) end ) addEventHandler("onPlayerWasted", root, function() local x = -1656 local y = -425 local z = 15 elseif local x = 1327 local y = 1537 local z = 15 spawnPlayer(source, x, y, z) fadeCamera(source, true) setCameraTarget(source, source) end ) Link to comment
NotAvailable Posted September 2, 2011 Share Posted September 2, 2011 This should work. addEventHandler("onPlayerJoin", root, function() local x = 1327 local y = 1537 local z = 15 spawnPlayer(source, x, y, z) fadeCamera(source, true) setCameraTarget(source, source) end ) addEventHandler("onPlayerWasted", root, function() local x = 1327 local y = 1537 local z = 15 spawnPlayer(source, x, y, z) fadeCamera(source, true) setCameraTarget(source, source) end ) Link to comment
CapY Posted September 2, 2011 Share Posted September 2, 2011 Did you read what i said , i said 3 random spawn places. Link to comment
NotAvailable Posted September 2, 2011 Share Posted September 2, 2011 Did you read what i said , i said 3 random spawn places. spawnTable = { {"0, 0, 3"}, {"7, 2, 3"}, {"4, 1, 3"} } Now, you do the rest. (math.random) It's time for you to read the wiki. Link to comment
CapY Posted September 2, 2011 Share Posted September 2, 2011 I'm on wiki everyday and worst problem i have is with tables and math , dammit i will just create a GUI . 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