So I am trying to make it that when you say, "appat" and then a players name, it teleports you them. However, I keep getting this stupid error:
https://gyazo.com/2733f0c0e2aca93b2c6b59918cfdf3be
Here is the code:
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
local lower = string.lower(msg) -- turns the letters inside the string to lowercase
if string.match(lower,"appat ") then
local sub = string.sub(msg,6,100)
print(sub.. "EXEISITIST")
dude = game.Players:FindFirstChild(sub).Name
local animation = game.Players:FindFirstChild(sub).Character.Humanoid:LoadAnimation(game.Players:FindFirstChild(sub).Backpack.flight)
animation:Play()
thats just a snippet of it
does anyone know how to fix this or why it's happening?
