if string.sub(msg, 6, 14) == "teleport " then
said = string.sub(msg, 16)
local placeHolder
for i = (said + 1), string.len(msg) do
if string.sub(msg, i, i + 1) == " " then
placeHolder = i
break
end
end
placeHolder = game.Players[string.find(string.lower(placeHolder.Name), msg)]
look = game.Players:GetChildren()
for i = 1, #look do
if string.find(string.lower(look[i].Name), said) == 1 then
SPL = Instance.new("SelectionPartLasso")
SPL.Color = BrickColor.new("Really black")
SPL.Humanoid = look[i].Character.Humanoid
SPL.Name = "SPL"
SPL.Parent = Workspace
SPL.Part = Pet
SPL.Visible = true
wait((math.pi*2)/10)
SPL:Remove()
look[i].Character.Torso.CFrame = placeHolder.Torso.CFrame
end
end
end
Unless you wanted your command to be "teleportLPGhatguy", you need to change where you start checking for the string. |