|
| 20 Mar 2014 08:05 PM |
I have a value in workspace change on click of a GUI which I know works because I tested it in studio. It changes the value of the IntValue to 5 which I also checked. Can someone explain why this doesnt work?
local player = script.Parent.Parent.Parent.Parent.Parent.Parent
function Click(mouse) player.TeamColor = BrickColor.new("Really red") end if workspace.GUI.Value==5 then script.Parent.MouseButton1Down:connect(Click) end function Die(mouse) player.Character.Humanoid:TakeDamage(100) end if worksace.GUI.Value==5 then script.Parent.MouseButton1Down:connect(Die) end
|
|
|
| Report Abuse |
|
|
RA2lover
|
  |
| Joined: 09 Nov 2008 |
| Total Posts: 1254 |
|
|
| 20 Mar 2014 08:07 PM |
>local player = script.Parent.Parent.Parent.Parent.Parent.Parent
eww |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2014 08:11 PM |
| Ya I have that script deep, what is the big deal? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 20 Mar 2014 08:11 PM |
| wait until the value is not nil |
|
|
| Report Abuse |
|
|
RA2lover
|
  |
| Joined: 09 Nov 2008 |
| Total Posts: 1254 |
|
|
| 20 Mar 2014 08:16 PM |
you're not obtaining the mouse object
your functions don't trigger
workspace.GUI may not be a value
repeating same logic block twice
>Ya I have that script deep, what is the big deal?
you can either place your script closer to the player object, or just use LocalPlayer instead |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2014 08:17 PM |
I have the value set at zero and it hasnt changed yet but this says that it doesn`t equal 0 and runs the code, why?
if workspace.GUI.Value ~= nil then script.Parent.MouseButton1Down:connect(Click) print'Work1' |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 20 Mar 2014 08:17 PM |
"you're not obtaining the mouse object" he doesn't need that |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2014 08:18 PM |
| I worked until I made it conditional so everything but the condition works... |
|
|
| Report Abuse |
|
|
|
| 20 Mar 2014 09:17 PM |
| Allow me to explain myself a little bit further. I need the team change only to work if they have accepted the rules. The agree button on the rules makes the rules GUI invisible and also makes the intvalue 5. I was hoping then it would allow them to use the team switch but that didnt work, any reason why? |
|
|
| Report Abuse |
|
|
| |
|
| |
|