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
|
  |
| Joined: 16 May 2012 |
| Total Posts: 1073 |
|
| |
|
|
| 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
|
  |
| Joined: 16 May 2012 |
| Total Posts: 1073 |
|
|
| 20 Nov 2016 03:15 PM |
What does Filtering do?
Xasix | Ex-Assist |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 16 May 2012 |
| Total Posts: 1073 |
|
| |
|
|
| 20 Nov 2016 03:26 PM |
| Yes, LocalScripts should always be used for GUIs. |
|
|
| Report Abuse |
|
|