Could someone tell me how I put a message in text label for the player as soon as he enters a specific team and I just want the message to appear only for the player who joins the team could someone explain to me how I can do this? I used a method to clone the gui when it detected the player in the team but it didn't work :^
✓ ANSWER ACCEPTED
someone explain to me how i make messages appear for plr in a team.?
1 answer
✓ Accepted answer
Make a LocalScript inside of StarterGui and place your GUI inside the LocalScript.
Paste this into the LocalScript. You can remove the comments in the script, they are just there to help you modify the script.
local player = game.Players.LocalPlayer -- The player
local gui = script:WaitForChild("ScreenGui") -- The GUI / Change "ScreenGui" to the name of your GUI
player:GetPropertyChangedSignal("Team"):Connect(function() -- Fires everytime the "Team" value of the player is changed
local team = player.Team.Name -- The name of the team.
if team == "Team Blue" then -- Change "Team Blue" to the name of the specific team
gui.Enabled = true -- Enables the GUI
else
gui.Enabled = false -- Ensures that if you change your team the GUI will not show
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
