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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Script Not Working PLEASE HELP

Previous Thread :: Next Thread 
Xasix is not online. Xasix
Joined: 16 May 2012
Total Posts: 1073
20 Nov 2016 03:08 PM
script.Parent.MouseButton1Click:connect(function()
if
game.Workspace.MainEntryDoors.CanCollide = false
game.Workspace.MainEntryDoors.Transparency = 0 then
game.Workspace.MainEntryDoors.CanCollide = true
game.Workspace.MainEntryDoors.Transparency = 1
script.Parent.Text = "Close The Doors"
elseif
game.Workspace.MainEntryDoors.CanCollide = true
game.Workspace.MainEntryDoors.Transparency = 1 then
game.Workspace.MainEntryDoors.CanCollide = false
game.Workspace.MainEntryDoors.Transparency = 0
script.Parent.Text = "Open The Doors"
end)

its saying for the 3rd line:
'then' expected near '='

I don' get what that means. Please help. This is a regular script.


Xasix | Ex-Assist
Report Abuse
Xasix is not online. Xasix
Joined: 16 May 2012
Total Posts: 1073
20 Nov 2016 03:12 PM
bump


Xasix | Ex-Assist
Report Abuse
HumanXerxes is not online. HumanXerxes
Joined: 17 Apr 2011
Total Posts: 1351
20 Nov 2016 03:14 PM
The way you phrased your if statements is incorrect syntax. Also, this shouldn't matter but it's healthy to make a variable instead of saying "game.Workspace.MainEntryDoors" all the time:

local MED = game.Workspace.MainEntryDoors

script.Parent.MouseButton1Click:connect(function()
if MED.CanCollide == false and MED.Transparency == 0 then
MED.CanCollide = true
MED.Transparency = 1
script.Parent.Text = "Close The Doors"
elseif MED.CanCollide == true and MED.Transparency == 1 then
game.Workspace.MainEntryDoors.CanCollide = false
game.Workspace.MainEntryDoors.Transparency = 0
script.Parent.Text = "Open The Doors"
end
end)

And since this seems to be in a GUI, Filtering should not be enabled for this to work. If you want Filtering to be enabled (which you probably should), you'd have to use a RemoteEvent to alter the doors.
Report Abuse
Xasix is not online. Xasix
Joined: 16 May 2012
Total Posts: 1073
20 Nov 2016 03:15 PM
What does Filtering do?


Xasix | Ex-Assist
Report Abuse
HumanXerxes is not online. HumanXerxes
Joined: 17 Apr 2011
Total Posts: 1351
20 Nov 2016 03:17 PM
http://wiki.roblox.com/index.php?title=API:Class/Workspace/FilteringEnabled

It's a good defense against exploiters.
Report Abuse
Xasix is not online. Xasix
Joined: 16 May 2012
Total Posts: 1073
20 Nov 2016 03:20 PM
And this still isn't working. Should it be in a LocalScript? game: ###ps://www.roblox.com/games/408826647/Camp-Endrone Xasix | Ex-Assist
Report Abuse
Xasix is not online. Xasix
Joined: 16 May 2012
Total Posts: 1073
20 Nov 2016 03:25 PM
bump


Xasix | Ex-Assist
Report Abuse
HumanXerxes is not online. HumanXerxes
Joined: 17 Apr 2011
Total Posts: 1351
20 Nov 2016 03:26 PM
Yes, LocalScripts should always be used for GUIs.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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