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: Fix this small script for me and tell me what's wrong.

Previous Thread :: Next Thread 
slitherate is not online. slitherate
Joined: 05 Aug 2010
Total Posts: 466
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
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
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
slitherate is not online. slitherate
Joined: 05 Aug 2010
Total Posts: 466
24 Apr 2013 03:13 PM
Of course! If Baseplate.Transparency "is equal to" 0, then make it visible!! Thanks!
Report Abuse
slitherate is not online. slitherate
Joined: 05 Aug 2010
Total Posts: 466
24 Apr 2013 03:17 PM
It didn't work! Nothing happened to the baseplate! Output didn't return anything either! =/
Report Abuse
slitherate is not online. slitherate
Joined: 05 Aug 2010
Total Posts: 466
24 Apr 2013 03:23 PM
Bump
Report Abuse
jhend27513 is not online. jhend27513
Joined: 17 Sep 2011
Total Posts: 3369
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 is not online. 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
KillerKyle is not online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
24 Apr 2013 03:55 PM
Ther is no wait time. It all happened in a fraction of a second.
Report Abuse
sayhisam1 is not online. sayhisam1
Joined: 25 Nov 2009
Total Posts: 2092
24 Apr 2013 03:57 PM
^
That is also true.
Report Abuse
slitherate is not online. slitherate
Joined: 05 Aug 2010
Total Posts: 466
24 Apr 2013 04:14 PM
I got this message from Output.

Workspace.Baseplate.Script:13: 'then' expected near '='
Report Abuse
slitherate is not online. slitherate
Joined: 05 Aug 2010
Total Posts: 466
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
slitherate is not online. slitherate
Joined: 05 Aug 2010
Total Posts: 466
24 Apr 2013 04:27 PM
Bump
Report Abuse
TheGamer101 is not online. TheGamer101
Joined: 14 Feb 2009
Total Posts: 11943
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 is not online. KeyUp
Joined: 17 Mar 2013
Total Posts: 457
24 Apr 2013 04:52 PM
[ Content Deleted ]
Report Abuse
MarkedSpookyCat is not online. MarkedSpookyCat
Joined: 16 May 2010
Total Posts: 13
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
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