Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

How do I fix this Map loading script?

Asked by 6 years ago

Hi, I am a beginner in Lua, I tried to make a script that loads a map onto the workspace and then teleports the players to the spawn place of each group, I tried the loading maps script and it worked, but I have no Idea on how to teleport a player to a place and make him spawn only in that place until the round is completed.

Please help me ,I tried opening catalog and searching for map loaders, but the seem to be much advanced.

wait(10)
game.ServerStorage.Lava:Clone().Parent = game.Workspace
game.ServerStorage.Weapons.Sword:Clone().Parent = game.Player:FindFirstChild("Backpack")
wait(300)
game.Workspace.Lava:Destroy()
game.Players:kill()
wait(10)
-- other map coming soon

2 answers

Log in to vote
0
Answered by 6 years ago

First of all, it's Game.Players not game.Player.

Second, if you want to kill all the players use this:

p = game.Players:GetChildren()

for i = 1,#p do
  p[i].Character.Head:remove()
end

Good job so far. Just gotta keep practicing.

0
Ohh thx, I need to practice more on thr for thing, I am confused onto it, But okay... (Though it's not the answer I was looking for but thx!) buoyantair 123 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

Pretty Sure That The Game.players:kill() Wont do anything

0
I made it to kill all the players and to respawn them in lobby(I really dont know if that works) buoyantair 123 — 6y

Answer this question