Hello, I need to add a warning message in my code and I have a screengui, frame and textlabel already created and with their respective messages, I would like to be able to show these messages to specific players following the following form of writing in the chat:
message β message == '.warn ' .. Player2.Name
What I need is enable and disable the playerGUI of player2 in the code, how can I do that?
Iβm not really sure how to enable the screengui of a specific player, is this possible and how can I do it?
script:
-- warn player message
if Player.TeamColor == BrickColor.new("Lapis") then
for i,Player2 in pairs(Players:GetPlayers()) do
if message == '.warn ' .. Player2.Name then
print("The player name is ..." .. Player2.Name)
print("The administrator has given you a warning")
-- code to warning here:
end
end
end
if Player.TeamColor == BrickColor.new("Lapis") then
for i,Player2 in pairs(Players:GetPlayers()) do
if message == '.warn ' .. Player2.Name then
print("The player name is ..." .. Player2.Name)
print("The administrator has given you a warning")
-- code to warning here:
Player2.PlayerGui.Warning.Enabled = true
Player2.PlayerGui.Warning.Frame.TextLabel = "The warning here"
wait(1) -- time until disable
Player2.PlayerGui.Warning.Enabled = false
end
end
end