Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

someone explain to me how i make messages appear for plr in a team.?

Asked by 2 years ago

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 :^

1 answer

Log in to vote
0
Answered by 2 years ago

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)
Ad

Answer this question