function Click(mouse) if script.Parent.Parent.Parent.Parent.Parent.TeamColor ~= game.Teams.Pirus.TeamColor then script.Parent.Parent.Parent.Parent.Parent.TeamColor = game.Teams.Pirus.TeamColor end end Player = script.Parent.Parent.Parent.Parent.Parent if Player ~= nil then if Player.TeamColor == game.Teams.Pirus.TeamColor then Player.Humanoid.Walkspeed = 100 end end script.Parent.MouseButton1Click:connect(Click)
Hello, I am Yeevivor4. What I'm trying to make is that, if you click on a gui, it puts you on a team. What I'm trying to do is that, if you press on that gui and you're on the team, you will get 100 walkspeed. I don't know why it is not working. Can any GUI geniuses help me with this? Also script.Parent.Parent.Parent.Parent.Parent.TeamColor
is just the Player's TeamColor.
~Thanks for reading, Yeevivor4.
function Click(mouse) if script.Parent.Parent.Parent.Parent.Parent.TeamColor ~= game.Teams.Pirus.TeamColor then script.Parent.Parent.Parent.Parent.Parent.TeamColor = game.Teams.Pirus.TeamColor end end Player = script.Parent.Parent.Parent.Parent.Parent if Player ~= nil then if Player.TeamColor == game.Teams.Pirus.TeamColor then Player.Humanoid.WalkSpeed = 100 --WalkSpeed end end script.Parent.MouseButton1Click:connect(Click)
You could add a Value into the player and check if the player's value is a certain number like
if player.Torso.IntValue.Value >= 3 then -- Your Script here end