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: Will this work?

Previous Thread :: Next Thread 
Keyrut is not online. Keyrut
Joined: 23 Nov 2011
Total Posts: 6501
16 Aug 2012 01:25 PM
local red1 = script.Parent.reda
local red2 = script.Parent.redb
local red3 = script.Parent.redc
--red section
----------------------------------<-Divider->
--blue section
local blu1 = script.Parent.bluea
local blu2 = script.Parent.blueb
local blu3 = script.Parent.bluec
while wait() do if
game.Workspace.Capturea.Stat.Value = true
script.Parent.red1.Visible = true
script.Parent.blu1.Visible = false
--
game.Workspace.Captureb.Stat.Value = true
script.Parent.red2.Visible = true
script.Parent.blu2.Visible = false
--
game.Workspace.Capturec.Stat.Value = true
script.Parent.red3.Visible = true
script.Parent.blu3.Visible = false
-- Above = if raider takes the flag.
-- True and False border?
-- Below = if UNSC takes the flag.
game.Workspace.Capturea.Stat.Value = false
script.Parent.red1.Visible = false
script.Parent.blu1.Visible = true
--
game.Workspace.Captureb.Stat.Value = false
script.Parent.red2.Visible = false
script.Parent.blu2.Visible = true
--
game.Workspace.Capturec.Stat.Value = false
script.Parent.red3.Visible = false
script.Parent.blu3.Visible = true
end
end
Report Abuse
Mathfreak231 is not online. Mathfreak231
Joined: 21 Jun 2010
Total Posts: 5311
16 Aug 2012 01:28 PM
Use "and" for multiple statements and "==" for checking if two values are equal.

if
((this == true) and
(that == true) and
(stuff == false)) then
--blah
end
Report Abuse
Keyrut is not online. Keyrut
Joined: 23 Nov 2011
Total Posts: 6501
16 Aug 2012 01:28 PM
er
wat
Report Abuse
xXTheRobotXx is not online. xXTheRobotXx
Joined: 05 May 2012
Total Posts: 13343
16 Aug 2012 01:29 PM
All your value =

need to be value ==
Report Abuse
Keyrut is not online. Keyrut
Joined: 23 Nov 2011
Total Posts: 6501
16 Aug 2012 01:33 PM
local red1 == script.Parent.reda
local red2 == script.Parent.redb
local red3 == script.Parent.redc
--red section
----------------------------------<-Divider->
--blue section
local blu1 == script.Parent.bluea
local blu2 == script.Parent.blueb
local blu3 == script.Parent.bluec
while wait() do if
game.Workspace.Capturea.Stat.Value == true
script.Parent.red1.Visible == true
script.Parent.blu1.Visible == false
--
game.Workspace.Captureb.Stat.Value == true
script.Parent.red2.Visible == true
script.Parent.blu2.Visible == false
--
game.Workspace.Capturec.Stat.Value == true
script.Parent.red3.Visible == true
script.Parent.blu3.Visible == false
-- Above = if raider takes the flag.
-- True and False border?
-- Below = if UNSC takes the flag.
game.Workspace.Capturea.Stat.Value == false
script.Parent.red1.Visible == false
script.Parent.blu1.Visible == true
--
game.Workspace.Captureb.Stat.Value = false
script.Parent.red2.Visible == false
script.Parent.blu2.Visible == true
--
game.Workspace.Capturec.Stat.Value == false
script.Parent.red3.Visible == false
script.Parent.blu3.Visible == true
end
end
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
16 Aug 2012 01:34 PM
Not all of them... Only when you have an "if", and when you do, put a "then".

† KMXD †
Report Abuse
Keyrut is not online. Keyrut
Joined: 23 Nov 2011
Total Posts: 6501
16 Aug 2012 01:41 PM
local red1 = script.Parent.reda
local red2 = script.Parent.redb
local red3 = script.Parent.redc
--red section
----------------------------------<-Divider->
--blue section
local blu1 = script.Parent.bluea
local blu2 = script.Parent.blueb
local blu3 = script.Parent.bluec
while wait() do if then
game.Workspace.Capturea.Stat.Value == true
script.Parent.red1.Visible == true
script.Parent.blu1.Visible == false
--
game.Workspace.Captureb.Stat.Value == true
script.Parent.red2.Visible == true
script.Parent.blu2.Visible == false
--
game.Workspace.Capturec.Stat.Value == true
script.Parent.red3.Visible == true
script.Parent.blu3.Visible == false
-- Above = if raider takes the flag.
-- True and False border?
-- Below = if UNSC takes the flag.
game.Workspace.Capturea.Stat.Value == false
script.Parent.red1.Visible == false
script.Parent.blu1.Visible == true
--
game.Workspace.Captureb.Stat.Value = false
script.Parent.red2.Visible == false
script.Parent.blu2.Visible == true
--
game.Workspace.Capturec.Stat.Value == false
script.Parent.red3.Visible == false
script.Parent.blu3.Visible == true
end
end
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
16 Aug 2012 01:46 PM
UGM ufail whoever said you need == for everything! Dumbo!

local red1 = script.Parent.reda
local red2 = script.Parent.redb
local red3 = script.Parent.redc


local blu1 = script.Parent.bluea
local blu2 = script.Parent.blueb
local blu3 = script.Parent.bluec

while true do

if game.Workspace.Capturea.Stat.Value == true then
script.Parent.red1.Visible = true
script.Parent.blu1.Visible = false
end

if game.Workspace.Captureb.Stat.Value == true then
script.Parent.red2.Visible = true
script.Parent.blu2.Visible = false
end

if game.Workspace.Capturec.Stat.Value == true then
script.Parent.red3.Visible = true
script.Parent.blu3.Visible = false
end

if game.Workspace.Capturea.Stat.Value == false then
script.Parent.red1.Visible = false
script.Parent.blu1.Visible = true
end

if game.Workspace.Captureb.Stat.Value == false then
script.Parent.red2.Visible == false
script.Parent.blu2.Visible == true
end

if game.Workspace.Capturec.Stat.Value == false then
script.Parent.red3.Visible == false
script.Parent.blu3.Visible == true
end

end

It would be more efficient to make a .Changed function. I am not going to write all that for you though. :3

-------------------------
~thedestroyer115, some of the most kind and helpful posts possible!~
Report Abuse
Mathfreak231 is not online. Mathfreak231
Joined: 21 Jun 2010
Total Posts: 5311
16 Aug 2012 01:49 PM
@destroyer

you need a wait() so it doesn't crash

and you defined the variables but didn't even use them

"UGM ufail whoever said you need == for everything! Dumbo!"

very "kind"

change ur sig pl0x

~This sig is false~
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
16 Aug 2012 01:52 PM
Who said I didn't want to crash his Roblox tab? ;)

Yes add a wait(0.5) before the last end.

And hey, I am not going to clean the mess he made. I am only going to fix it.

-------------------------
~thedestroyer115, some of the most kind and helpful posts possible!~
Report Abuse
Mathfreak231 is not online. Mathfreak231
Joined: 21 Jun 2010
Total Posts: 5311
16 Aug 2012 01:55 PM
calling someone a "dumbo" is not one of "the most kind and helpful posts possible!"

~This sig is false~
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
16 Aug 2012 01:57 PM
-------------------------
~thedestroyer115, some of the most kind and helpful posts possible (But not to xXTheRobotXx)!~

Vala

-------------------------
~thedestroyer115, some of the most kind and helpful posts possible!~
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