Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Why doesnt my teleportation script teleport anyone to anyone anymore?

Asked by 3 months ago

local script:

local player = game.Players.LocalPlayer

local remoteEvent = game.ReplicatedStorage:WaitForChild("playertp")



player.Chatted:Connect(function(msg)

if msg:lower():match("goto") then

local targetPlayer = game.Players:FindFirstChild(msg:sub(6))

if targetPlayer and targetPlayer.Character then

player.Character.HumanoidRootPart.CFrame = CFrame.new(targetPlayer.Character.Head.Position)

end

elseif msg:lower():match("get") then

local targetPlayer = game.Players:FindFirstChild(msg:sub(5))



if targetPlayer and targetPlayer.Character then

remoteEvent:FireServer(targetPlayer.Character)



end

end

end)

server script:

local remoteEvent = game.ReplicatedStorage:WaitForChild("playertp")



remoteEvent.OnServerEvent:Connect(function(player, target)



target.HumanoidRootPart.CFrame = CFrame.new(player.Character.Head.Position)



end)

it is mean to teleport me to whoever i say when i say goto followed by the player name and teleport the player to me when i say get followed by the player name but its not anymore. also i get no errors in the output

0
This entire thing can be done in the server script BlackOrange3343 2397 — 3mo

Answer this question