Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Need help changing my current script?

Im trying to create a free 4 all fighting game that has all players at a lobby and when the game starts a random map is selected and whoever gets the most kills when time is up wins then all players are teleported back the lobby waiting for the next round to start but honestly im fairly new to scripting and recently devoted time to learning it but i only know how to do basic things

in conclusion is there anybody willing to help me create a script that can work like this this is the current map changer script i have but i want to include a lobby rounds and player wins with most kills

Much Thanks in advance

while true do

game.Lighting.Map1:clone().Parent = game.Workspace

wait(120)

local msg = Instance.new("Message")

msg.Parent = game.Workspace

msg.Text = (" Map1")

msg:remove()

game.Workspace.Map1:remove()

	wait(2)

game.Lighting.Map2:clone().Parent = game.Workspace

	wait(10)

msg.Parent = game.Workspace

msg.Text = (" Map2")

wait(4)

msg:remove()

game.Workspace.Map2:remove()

wait(2) 

game.Lighting.Map3:clone().Parent = game.Workspace

wait(120)

msg.Parent = game.Workspace

msg.Text = (" Map3")

wait(4)

msg:remove()

game.Workspace.Map3:remove()

wait(2)

end

1 comment

0

Fix up the code block, its only got half of the code.

1 answer

To get all of the players ingame and teleport them:

Local a = game.Players: GetChildren()

For _,P in pairs (a) do
P.Character.Torso.CFrame = TeleportPart1.Position + Vector3.new(0,7,0)
End

At the end of the round, do the same, but find their leaderstat value for kills and compare them to other's, and kill the players so they respawn at the lobby.

To get a leaderstat value:

P.leaderstat.Kills

To kill a player:

P.Character:BreakJoints()

This discussion is preserved as it was. New answers, comments, and votes are closed.