local GroupId = 5774015
local httpService = game:GetService("HttpService")
local webhookURL = "MyWebhookURLwhichIdontshare"
local minimumRankToUseCommmand = 3
local function ContactER(DiscordMessage)
local Data = {
["content"] = DiscordMessage
}
Data = httpService:JSONEncode(Data)
httpService:PostAsync(webhookURL,Data)
end
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(Character)
local WarningGui = script.WarnGui:Clone()
WarningGui.Parent = Character.Head
end)
player.Chatted:Connect(function(Message)
local SplitMessage = Message:split(" ")
if player:GetRankInGroup(GroupId) >= minimumRankToUseCommmand and SplitMessage[1] == "!warn" then
local NameOfPlayerToWarn = SplitMessage[2]
local PlayertoWarn = game.Players:FindFirstChild(NameOfPlayerToWarn)
local Reason = Message:split(NameOfPlayerToWarn)[2]
local WarningGuiClone = PlayertoWarn.Character.Head:WaitForChild("WarnGui")
local currentWarnings = WarningGuiClone.Warnings.value
currentWarnings.Value = currentWarnings.Value + 1
WarningGuiClone.WarnLabel.Text = "W"..currentWarnings.Value.." - "..Reason
if currentWarnings.Value >= 3 then
ContactER("<@&765289353215606834>, "..NameOfPlayerToWarn.."has been reported for: "..Reason)
end
end
end)
end)
When I warn a user the GUI doesnt change text