Hi, I need help with an idea I've had for an admin only teleport command script that when you want to teleport to another player, the player your wanting to teleport to will have a gui to confirm the teleport.
I don't really have any code for this so I was wondering if anyone here could help me out. I've already got my primary commant script sorted out with removing the ability to use its teleport command.
Try using this:
game.Players.PlayerAdded:connect(function(pName) pName.Chatted:connect(function (msg) if string.sub(string.lower(msg),1,3) == "tp/" then local requester = pName local tpr = game.Lighting.TpRequestOrig:clone() tpr.Frame.textST.Text = (requester).." would like to teleport to you. Do you aprove? Say (/yes) or (/no)" local nm = string.sub(string.lower(msg),4) for _,v in pairs(game.Players:GetChildren()) do if string.lower(nm) == string.lower(v) then tpr.Parent = v.PlayerGui end end elseif string.sub(string.lower(msg),1,4) == "/yes" then requester:MoveTo(nm.Character.Torso.Position) trp:Destroy() elseif string.sub(string.lower(msg),1,3) == "/no" then tpr:Destroy() end end) end)
Use _G to send data between multiple scripts. This will not work with local scripts. Plan accordingly, you will also need a table.