|
| 24 Apr 2013 03:08 PM |
I am a basic Lua learner. Learning more and more and what's wrong with this? Please fix it and explain it to me. Script below (with comments!)
Baseplate = script.Parent.Baseplate --This gets the Baseplate
if Baseplate.Transparency = 0 then --If it's invisible.. Baseplate.Transparency = 1 --Make it visible! end --Ends this function if Baseplate.Transparency = 1 then --If it's visible.. Baseplate.Transparency = 0 --Make it visible! end --Ends this function
Output says: Workspace.Script:3: 'then' expected near '=' -- What does that mean? |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2013 03:10 PM |
Baseplate = script.Parent.Baseplate --This gets the Baseplate
if Baseplate.Transparency == 0 then --If it's invisible.. Baseplate.Transparency = 1 --Make it visible! end --Ends this function if Baseplate.Transparency == 1 then --If it's visible.. Baseplate.Transparency = 0 --Make it visible! end --Ends this function
1. Conditional statements(if&then) need a "==" sign instead of a single "=" 2. Youre not ending a function, but a conditional statement
|
|
|
| Report Abuse |
|
|
|
| 24 Apr 2013 03:13 PM |
| Of course! If Baseplate.Transparency "is equal to" 0, then make it visible!! Thanks! |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2013 03:17 PM |
| It didn't work! Nothing happened to the baseplate! Output didn't return anything either! =/ |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Apr 2013 03:48 PM |
Baseplate = script.Parent -- if this is INSIDE the baseplate
if Baseplate.Transparency = 1 then Baseplate.Transparency = 0 wait(1) if Baseplate.Transparency = 0 then Baseplate.Transparency = 1 end
~Let's go! Down to the rides on East Parade by the lights of the palace arcade, And watch night coming down on the Sovereign Light Café~ |
|
|
| Report Abuse |
|
|
sayhisam1
|
  |
| Joined: 25 Nov 2009 |
| Total Posts: 2092 |
|
|
| 24 Apr 2013 03:52 PM |
Use findFirstChild put this for baseplate on the top:
Baseplate = game.Workspace:findFirstChild("Baseplate") |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2013 03:55 PM |
| Ther is no wait time. It all happened in a fraction of a second. |
|
|
| Report Abuse |
|
|
sayhisam1
|
  |
| Joined: 25 Nov 2009 |
| Total Posts: 2092 |
|
| |
|
|
| 24 Apr 2013 04:14 PM |
I got this message from Output.
Workspace.Baseplate.Script:13: 'then' expected near '=' |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2013 04:16 PM |
This is the script that the Output is from.
01--[[msg = Instance.new("Message") 02msg.Text = "Hi?" 03wait(1) 04msg.Text = "This script is ending!" 05wait(1) 06msg:remove() 07wait(2) 08msg2 = Instance.new("Message") 09msg2.Text = "The message doesn't appear!! :( It appears on the first part!"--]] 10 11Baseplate = game.Workspace:findFirstChild("Baseplate") 12 13if Baseplate.Transparency = 1 then 14Baseplate.Transparency = 0 15wait(1) 16if Baseplate.Transparency = 0 then 17Baseplate.Transparency = 1 18end
The first 2 numbers are the line #. |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Apr 2013 04:30 PM |
"if Baseplate.Transparency = 1 then "
This was fixed earlier in the thread. It needs a second =. |
|
|
| Report Abuse |
|
|
KeyUp
|
  |
| Joined: 17 Mar 2013 |
| Total Posts: 457 |
|
| |
|
|
| 27 Oct 2014 06:39 PM |
BasePlate = game.Workspace.BasePlate.Transparency
if BasePlate == 0 then BasePlate = 1 end
if BasePlate == 1 then BasePlate = 0 end
~ MarkedFirecAT |
|
|
| Report Abuse |
|
|