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

I cant seem to teleport the player?!?

Asked by 5 years ago
Edited 5 years ago
01local maps = game.ServerStorage.Maps:GetChildren()
02local Storage = game.Workspace.MapStorage
03local PLR = game.Players.LocalPlayer.Character
04local Point = game.Workspace.Hub.Spawn
05local Point2 = game.Workspace.Point2
06while true do
07 local random_map = maps[math.random(1,#maps)]
08 random_map:Clone().Parent = Storage
09 wait (5)
10     PLR.HumanoidRootPart.CFrame = CFrame.new(math.random(-178,-218), 19, math.random(156,196))
11 wait (60)
12     PLR.HumanoidRootPart.CFrame = CFrame.new(math.random(39,79), 19, math.random(152,192))
13     Storage:ClearAllChildren()
14 wait (15)
15end

Before-- Now ---

01local PLR = game.Players.LocalPlayer.Character
02local Point = game.Workspace.Hub.Spawn
03local Point2 = game.Workspace.Point2
04local PLRname = game.Players.LocalPlayer.Name
05while true do
06    wait (5)
07    PLR.HumanoidRootPart.CFrame = CFrame.new(math.random(39,79), 19, math.random(152,192))
08    wait (60)
09    PLR.HumanoidRootPart.CFrame = CFrame.new(math.random(-178,-218), 19, math.random(156,196))
10    wait (15)
11end

The teleport still seems to not work.

1
If this is a local script, ServerStorage can’t be used, If this is a server script, LocalPlayer can’t be used. cegberry 432 — 5y
0
No its in a normal script... CNK12321 0 — 5y
0
yea then you should change the way you get player 0msh 333 — 5y
0
Like how? CNK12321 0 — 5y
View all comments (6 more)
0
Oh I see now i just gotta split the scripts up Thanks! :D CNK12321 0 — 5y
0
Still the teleport dose not work CNK12321 0 — 5y
0
Maybe you can do game.Players.PlayerAdded:Connect(function(p) end) User#29913 36 — 5y
0
to get the plr User#29913 36 — 5y
0
ok i will try CNK12321 0 — 5y
0
Erm still dose not work CNK12321 0 — 5y

1 answer

Log in to vote
0
Answered by
H34E7R 19
5 years ago

Try setting the HumanoidRootPart's Position of the Character. (make sure it's server side)

Ex:

1Player.Character.HumanoidRootPart.Position = (position here)
Ad

Answer this question