|
| 07 Jan 2013 03:43 AM |
Hi guys,
I need help with my gui on my place. So, I need a "change team GUI" for my group base. This allows with a click of a button to change team. I cannot get it working, I have 3 teams (Raiders, allies and K.A.R) But only Raiders and allies work? When I click on K.A.R it will kill me, but not change spawn or team? Please help me as fast as possible. Thanks |
|
|
| Report Abuse |
|
|
Colbie988
|
  |
| Joined: 03 Mar 2012 |
| Total Posts: 885 |
|
|
| 07 Jan 2013 07:04 AM |
| Mind posting the script here so I could check it? |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2013 07:12 AM |
Sure!
THIS IS FOR THE RAIDERS (MAGENTA COLOUR)
Group ID:
function Click(mouse) if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(131688) then script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Magenta") end end
script.Parent.MouseButton1Click:connect(Click)
Kill:
function onButtonClicked() script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 end
script.Parent.MouseButton1Click:connect(onButtonClicked) |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2013 07:43 AM |
| Try removing the 'Mouse' inside the function. The Kill script doesn't appear to need it... (No garuntees) |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2013 07:58 AM |
| Ok, It still doesn't work. Without the 'Mouse' it isn't clickable. Thanks anyways! |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2013 08:14 AM |
I've checked the one that I use, that works fine, then yours, and the only difference I can find is the ID, Color, and pathways. Try checking to make sure you don't have too many/not enough '.Parents' in the script.
Here's mine if you wanna have a look:
function Click(mouse) if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(ID) then script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Color") end end
script.Parent.MouseButton1Click:connect(Click) |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2013 08:15 AM |
| Actually, nevermind. Mine doesn't seem to work anymore... ¬_¬ |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2013 08:17 AM |
| Aha Ok, thanks for the tips ;) |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2013 08:19 AM |
| I'll tell you once i've figured it out. :P |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2013 08:22 AM |
| Ok thanks, I am still trying now ;) |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2013 08:25 AM |
Got it, you need to put it in a 'LocalScript' instead of just a 'Script'
|
|
|
| Report Abuse |
|
|
|
| 07 Jan 2013 08:36 AM |
| Really?! Please can you explain that to me, i am a noob at this... |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2013 08:54 AM |
Okay, if you select the Parent of where you want the script to be, then look around the top bar for an 'Insert' button. Click on it, then click 'Object'. A whole bunch of different things will pop up, Parts, Values, Scripts, etc... Look around for a 'LocalScript'. It's like a normal script, just with a little head poking out, click on it, then click Ok.
You've inserted a LocalScript. ^-^ |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2013 09:44 AM |
| Can you describe the hierarchy? |
|
|
| Report Abuse |
|
|
Colbie988
|
  |
| Joined: 03 Mar 2012 |
| Total Posts: 885 |
|
|
| 07 Jan 2013 04:29 PM |
Woops sorry, u replied so long that I fell to sleep. Not seriously... Btw Scripts are scripts which are accessable to all players in one game while LocalScripts are accesible by one player in one game meaning all players have them but others cannot see.
Scripts= Public Local= Personal > Usually for GUIs.
|
|
|
| Report Abuse |
|
|