Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesnt this teleportation chat script work anymore?

Asked by 5 years ago
local player = game.Players.LocalPlayer

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

player.Chatted:Connect(function(msg)

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

if game.Players:FindFirstChild(msg:sub(4)) then

local target = game.Players:FindFirstChild(msg:sub(4))

print(target.Name)

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

end

end

end)

nothing printed and no errors, none of my teleportation chat commands work anymore but why. and yes this is a local script

0
just wondering, whats the point of having a remoteEvent, if you never use it in the script Dalamix 26 — 5y
1
Chat should be managed from the server User#5423 17 — 5y
0
i use the remoteevent, i just didnt show what it does in this script but its there and chat has worked before from the client Gameplayer365247v2 1055 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
local player = game.Players.LocalPlayer

player.Chatted:Connect(function(msg)

if msg:sub(1,2):lower():match("tp") then

print(msg:sub(3)) if game.Players:FindFirstChild(msg:sub(4)) then

local target = game.Players:FindFirstChild(msg:sub(4))

print(target.Name)

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

end

end

end) You messed something up.

0
no i didnt Gameplayer365247v2 1055 — 5y
0
this is no difference to what i did in my script Gameplayer365247v2 1055 — 5y
0
For ME it worked Sonnenroboter 336 — 5y
Ad

Answer this question