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
 

Re: Conditional team change not working

Previous Thread :: Next Thread 
crazynerd11 is not online. crazynerd11
Joined: 07 Oct 2011
Total Posts: 335
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 is not online. 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
crazynerd11 is not online. crazynerd11
Joined: 07 Oct 2011
Total Posts: 335
20 Mar 2014 08:11 PM
Ya I have that script deep, what is the big deal?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
20 Mar 2014 08:11 PM
wait until the value is not nil
Report Abuse
RA2lover is not online. 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
crazynerd11 is not online. crazynerd11
Joined: 07 Oct 2011
Total Posts: 335
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 is not online. 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
crazynerd11 is not online. crazynerd11
Joined: 07 Oct 2011
Total Posts: 335
20 Mar 2014 08:18 PM
I worked until I made it conditional so everything but the condition works...
Report Abuse
crazynerd11 is not online. crazynerd11
Joined: 07 Oct 2011
Total Posts: 335
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
crazynerd11 is not online. crazynerd11
Joined: 07 Oct 2011
Total Posts: 335
20 Mar 2014 10:35 PM
4 hours later so bumping.
Report Abuse
crazynerd11 is not online. crazynerd11
Joined: 07 Oct 2011
Total Posts: 335
20 Mar 2014 10:36 PM
1* sorry!
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