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

How to make a team only button for my vehicle spawner?

Asked by 4 years ago

Basically I'm trying to make a city roleplay game, and I have a spawner that when you click the button it let a GUI with the list of the vehicles appear. I want to make a script that when you click the button the script makes sure that you are in the right team, and if you are in the right team it gives you the GUI. I know it's possibile and it's also easy, but I can't really make it. Here's a screen of the spawner I have.

https://gyazo.com/e731eea95d41639b32928d4284511e6e

Help me please.

1 answer

Log in to vote
0
Answered by 4 years ago

You should be able to do the following.

script.Parent.ClickDetector.MouseClick:Connect(function(plr)
    if plr.Team == game.Teams:FindFirstChild("TEAMNAME") then
        script.Gui:Clone().Parent = plr.PlayerGui
    end
end)
Ad

Answer this question