Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.