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

I cant seem to teleport the player?!?

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.

10 comments

1

If this is a local script, ServerStorage can’t be used, If this is a server script, LocalPlayer can’t be used.

0

No its in a normal script...

0

yea then you should change the way you get player

0

Like how?

0

Oh I see now i just gotta split the scripts up Thanks! :D

0

Still the teleport dose not work

0

Maybe you can do game.Players.PlayerAdded:Connect(function(p) end)

0

to get the plr

0

ok i will try

0

Erm still dose not work

1 answer

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

Ex:

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

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