Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My teleport script wont work! Play dont teleport to minigame! Help?

Asked by 6 years ago
while true do
wait(5) --Waits 1 minute in between games
m = Instance.new("Message") --Creates a new message
local players = game.Players:GetChildren() -- String array where we store all the players
local num = math.random(1,1) --Here, put (1,[total number of maps]
if num == 1 then --Copy and paste this next section for each map, changing the number from 1 to 2, 3, and so on.
m.Parent = game.Workspace --Puts our message in Workspace
m.Text = "Choosing Map..." --Feel free to change these next couple of lines as needed
wait(5)
m.Text = "Game Number " ..num.. "  Map Was Chosen"
wait(3)
m.Text = "Map made by Rocket12358_EXT"
wait(4)
m.Text = "[Game Will Start Shortly]"
wait(3)
m.Text = "This game lasts for [100] seconds."
wait(4)
m.Text = "Get ready"
wait(3)
m.Parent = nil
game.Lighting.Minigame1:clone().Parent = game.Workspace --Change the "Minigame1 to the name of your map (stored in Lighting)
m.Text = "Map is Loading"
wait(5) 
for i = 1, # players do
players[i].Character:MoveTo(Vector3.new(-57, 161.351, 800)) --Change these coordinates to where you want the players to spawn
wait(3)
game.Lighting.LinkedSword:clone().Parent = players[i].Backpack --Change LinkedSword to the name of a weapon (in Lighting) you want to give to the players. You can either delete this line or copy paste more of it.
end
wait(100) --This is how long the game will last
game.Workspace.Minigame1:Remove() --Change Minigame1 to the name of your map.
m.Parent = game.Workspace
m.Text = "Game over! Thank you for playing!"
wait(5)
m.Text = "You have 1 minute until the start of the next game."
wait(5)
m.Parent = nil
end
m:Remove()
players[m].Character:MoveTo(Vector3.new(-318.138, 40.556, 549.973)
end

what is wrong?? I want to make epic minigames game, please help

0
Alright. All i know its something to do with the last line. User#21406 0 — 6y
0
You should change the HRP CFrame, don't use moveto for teleporting User#20388 0 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

First off Stop using Lighting as storage, ServerStorage and ReplicatedStorage exist for these reasons. It's :Clone() not :clone(). It's :Destroy() not :Remove().

0
not working. Rocket12358_EXT 75 — 6y
Ad

Answer this question