Ok so basically i made a teleporting pad and rigged up with it is a gui that would cover the player's screen while teleporting, and i also want make it so the player can't move , i've tried but for some reason it just won't work
Here's the code
local tpTo = "TP2"
local Players = game:GetService('Players')
script.Parent.Touched:connect(function (hit)
if hit.Parent:FindFirstChild('Humanoid') then
local char = hit.Parent
if Players:FindFirstChild(char.Name) then
local plr = Players:FindFirstChild(char.Name)
local gui = plr.PlayerGui.questchat.Teleport
local human = hit.Parent.Humanoid
gui:TweenSize(UDim2.new(1,0,1,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quint,0.25)
wait(0.25)
if script.Parent.Locked == false and script.Parent.Parent:FindFirstChild(tpTo).Locked == false then
script.Parent.Locked = true
script.Parent.Parent:FindFirstChild(tpTo).Locked = true
local pos = script.Parent.Parent:FindFirstChild(tpTo)
human.WalkSpeed = 0
char:moveTo(pos.Position)
script.Parent.Locked = false
script.Parent.Parent:FindFirstChild(tpTo).Locked = false
end
gui:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.In,Enum.EasingStyle.Quint,1)
human.WalkSpeed = 16
end
end
end)

1 comment
I know about that, i still haven't figured my way around remote events, still a noobie to lua and learning new things everyday. Anyways any idea how to change the movespeed?