Here is a script I found on the DevForum, but I want to add it so that the receptionist can add someones username to the end of the command to teleport them. Here’s the script:
local players = game:GetService("Players")
local Group = id_here
local Rank = rank_here
players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
if msg == "!backstage" and plr:GetRankInGroup(Group) >= Rank then
plr.Character:SetPrimaryPartCFrame(CFrame.new(Vector3.new(10,10,10)))
end
end)
end)
local players = game:GetService("Players")
local Group = id_here
local Rank = rank_here
players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
local arguments = string.split(msg, "")
end
end)
end)
This works, it just doesn’t work if I put the username after -training (i customised it a bit)
local players = game:GetService("Players")
local Group = id_here
local Rank = rank_here
players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
local arguments = string.split(msg, "")
if msg == "!backstage" and plr:GetRankInGroup(Group) >= Rank then
plr.Character:SetPrimaryPartCFrame(CFrame.new(Vector3.new(10,10,10)))
end
end)
end)
I think that this should work with player usernames. Let me know if it helps.
local players = game:GetService("Players")
local Group = ID_Here
local Rank = Rank_Here
players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
if string.find(msg, "!backstage") and plr:GetRankInGroup(Group) >= Rank then
local arguments = string.split(msg, " ")
local PlayerToTP = players:FindFirstChild(arguments[2])
if PlayerToTP == nil then
warn("No player given or not found!")
else
PlayerToTP.Character:SetPrimaryPartCFrame(CFrame.new(Vector3.new(10,10,10)))
end
end
end)
end)