script.Parent.MouseButton1Click:Connect(function(plr)
local Char = plr.Character
local Root = chr:WaitForChild("HumanoidRootPart")
local Tele = workspace.Spawns:GetChildren()
local ChosenTele = Tele[math.random(1,#Tele)]
Root.CFrame = ChosenTele.CFrame
end)
script.Parent.MouseButton1Click:Connect(function(plr)
local Char = plr.Character
local Root = plr:WaitForChild("HumanoidRootPart")
local Tele = workspace.Spawns:GetChildren()
local ChosenTele = Tele[math.random(1,#Tele)]
Root.CFrame = ChosenTele.CFrame
end)
Oh I just realised it was a Gui and not a part… silly me! This one is final:
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
local Char = plr.Character
local Root = plr:WaitForChild("HumanoidRootPart")
local Tele = workspace.Spawns:GetChildren()
local ChosenTele = Tele[math.random(1,#Tele)]
Root.CFrame = ChosenTele.CFrame
end)
Haha.
No errors but still not working
Try this:
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
local Char = plr.Character
local Root = plr:WaitForChild("HumanoidRootPart")
local Tele = workspace.Spawns:GetChildren()
local ChosenTele = Tele[math.random(1,#Tele)]
Root.CFrame = ChosenTele.Position
end)
The output says this: Infinite yield possible on ‘Players.Kamlkaze_Kid:WaitForChild(“HumanoidRootPart”)’
I didn’t change anything
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
local Root = plr.Character:WaitForChild("HumanoidRootPart")
local Tele = workspace.Spawns:GetChildren()
local ChosenTele = Tele[math.random(1,#Tele)]
Root.CFrame = ChosenTele.Position
end)
I swear it’s because I’m just really sleepy right now lol. THIS SHOULD WORK. XD
Noice a little error but I got it thanks bro
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
local Root = plr.Character:WaitForChild("HumanoidRootPart")
local Tele = workspace.Spawns:GetChildren()
local ChosenTele = Tele[math.random(1,#Tele)]
Root.CFrame = ChosenTele.CFrame
end)
No worries. I deliberately changed that though, I believe it should still work? I always use part positions with player CFrames haha.