I need help with my PTS command that when an player says !pts, it will notify the player that the request has been send to an MR and that assistance will arrive shortly.
This is the ServerScriptService script I have:
local GroupId = 10558052 --REPLACE 0 WITH YOUR GROUP ID
local LowestStaffRank = 250 --REPLACE 0 WITH THE MINIMUM RANK ID TO RECEIVE PTS NOTIFICATIONS
game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(Message)
if Message == "!pts" then
for Index, StaffMember in ipairs(game.Players:GetPlayers()) do
if StaffMember:GetRankInGroup(GroupId) >= LowestStaffRank then
game.ReplicatedStorage.HelpNotifierEvent:FireClient(StaffMember, Player)
end
end
end
end)
end)
And this is the StarterGUI script I currently have:
local Player = game.Players.LocalPlayer
game.ReplicatedStorage.HelpNotifierEvent.OnClientEvent:Connect(function(PlayerNeedingHelp)
local TeleportPlayer = Instance.new("BindableFunction")
TeleportPlayer.OnInvoke = function()
Player.Character:SetPrimaryPartCFrame(PlayerNeedingHelp.Character:GetPrimaryPartCFrame())
end
game.StarterGui:SetCore("SendNotification", {
Title = PlayerNeedingHelp.Name .. " requested PTS",
Text = "Click to teleport to this user. Abuse of this system is not allowed.",
Duration = 15,
Button1 = "Teleport",
Callback = TeleportPlayer
})
end)