magnacata
|
  |
| Joined: 06 Nov 2011 |
| Total Posts: 496 |
|
|
| 19 Jan 2013 10:14 AM |
Yes, I try to use free-modeled teamchange GUI's. Sadly the visitor one works, raider one works, yet my team one never works.
(Yes I have changed the scripts group ID)
|
|
|
| Report Abuse |
|
8SunTzu8
|
  |
| Joined: 30 Sep 2011 |
| Total Posts: 8199 |
|
|
| 19 Jan 2013 10:23 AM |
This should work. Remove this line: "local AllyButton = script.Parent.Allies" if you don't have allies in your GUI. Name the buttons, "Defenders", "Visitors", and "Raiders". Text can be anything.
Heirarchy:
ScreenGui --Localscript --Raiders --Defenders --Visitors --Allies <-- Optional
You need your GUI layed out like that so all of the references line up correctly. Make sure you put this into a "Localscript" object. I didn't test, but it's really simple, and should work out fine.
wait(0.4) local player = game.Players.LocalPlayer local GroupID = 83255 --APN local RaiderButton = script.Parent.Raiders local VisitorButton = script.Parent.Visitors local AllyButton = script.Parent.Allies local DefenderButton = script.Parent.Defenders local DefenderColor = BrickColor.new("Bright blue") local AllyColor = BrickColor.new("Bright green") local RaiderColor = BrickColor.new("Bright red") local NeutralColor = BrickColor.new("Medium stone grey")
function OnClickA() --Defenders if player:IsInGroup(GroupID) then player.TeamColor = DefenderColor if player.Character:FindFirstChild("Humanoid") then player.Character.Humanoid.Health = 0 end end end
function OnClickB() --Allies player.TeamColor = AllyColor if player.Character:FindFirstChild("Humanoid") then player.Character.Humanoid.Health = 0 end end
function OnClickC() --Raiders player.TeamColor = RaiderColor if player.Character:FindFirstChild("Humanoid") then player.Character.Humanoid.Health = 0 end end
function OnClickD() --Visitors player.TeamColor = NeutralColor if player.Character:FindFirstChild("Humanoid") then player.Character.Humanoid.Health = 0 end end
DefenderButton.MouseButton1Down:connect(OnClickA) AllyButton.MouseButton1Down:connect(OnClickB) RaiderButton.MouseButton1Down:connect(OnClickC) VisitorButton.MouseButton1Down:connect(OnClickD)
"If you want to become a Developer or Innovator for CSA, contact me." |
|
|
| Report Abuse |
|