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 4 years ago
Edited 4 years ago
local maps = game.ServerStorage.Maps:GetChildren()
local Storage = game.Workspace.MapStorage
local PLR = game.Players.LocalPlayer.Character
local Point = game.Workspace.Hub.Spawn
local Point2 = game.Workspace.Point2
while true do
 local random_map = maps[math.random(1,#maps)]
 random_map:Clone().Parent = Storage
 wait (5)
     PLR.HumanoidRootPart.CFrame = CFrame.new(math.random(-178,-218), 19, math.random(156,196))
 wait (60)
     PLR.HumanoidRootPart.CFrame = CFrame.new(math.random(39,79), 19, math.random(152,192))
     Storage:ClearAllChildren()
 wait (15)
end

Before-- Now ---

local PLR = game.Players.LocalPlayer.Character
local Point = game.Workspace.Hub.Spawn
local Point2 = game.Workspace.Point2
local PLRname = game.Players.LocalPlayer.Name
while true do
    wait (5)
    PLR.HumanoidRootPart.CFrame = CFrame.new(math.random(39,79), 19, math.random(152,192))
    wait (60)
    PLR.HumanoidRootPart.CFrame = CFrame.new(math.random(-178,-218), 19, math.random(156,196))
    wait (15)
end

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 — 4y
0
No its in a normal script... CNK12321 0 — 4y
0
yea then you should change the way you get player 0msh 333 — 4y
0
Like how? CNK12321 0 — 4y
View all comments (6 more)
0
Oh I see now i just gotta split the scripts up Thanks! :D CNK12321 0 — 4y
0
Still the teleport dose not work CNK12321 0 — 4y
0
Maybe you can do game.Players.PlayerAdded:Connect(function(p) end) User#29913 36 — 4y
0
to get the plr User#29913 36 — 4y
0
ok i will try CNK12321 0 — 4y
0
Erm still dose not work CNK12321 0 — 4y

1 answer

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

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

Ex:

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

Answer this question