generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Teamchange GUI never works?

Previous Thread :: Next Thread 
magnacata is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image