|
| 17 Jun 2014 05:31 AM |
Well what this script does is it puts the player in the team once they clicked the GUI and they are in the group. But the problem is I don't know how to actually do that properly and here is my failed attempt:
function onClick() if script.Parent.Parent.Parent.Parent:IsInGroup(1019299) then script.Parent.Parent.Parent.Parent.Neutral = false script.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Bright blue") end end script.Parent.MouseButton1Click:connect(onClick)
Just so you know I have it set up like this:
Starter GUI -screen gui --text button ---This script
|
|
|
| Report Abuse |
|
|
|
| 17 Jun 2014 05:33 AM |
| I'v failed horribly haven't I. |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2014 05:57 AM |
Nvm. I'v managed to make it work. with this script:
local TeamColor = game.Teams["TeamNameHere"].TeamColor
function onClick() if script.Parent.Parent.Parent.Parent:IsInGroup(GroupIDHere) then script.Parent.Parent.Parent.Parent.Neutral = false script.Parent.Parent.Parent.Parent.TeamColor = TeamColor end end
script.Parent.MouseButton1Click:connect(onClick)
(It obviously it has the "groupidhere" and "teamnamehere" bits filled out for the actual thing) |
|
|
| Report Abuse |
|
|
domorox17
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 1710 |
|
|
| 17 Jun 2014 08:08 AM |
Let's simplify, shall we? In a local script
script.Parent.MouseButton1Click:connect(function() if game.Players.LocalPlayer:IsInGroup(1019299) then game.Players.LocalPlayer.TeamColor = BrickColor.new('Bright blue') end end) |
|
|
| Report Abuse |
|
|