Hello. I am currently trying to develop a door that can be locked with the enablement of just one simple value. I've tried a lot of things and after some experimenting I've realised that the "Handler" script is doing absolutely nothing at all. The following script is supposed to change something when the value in the model is changed. Here is the code.
local Closed = script.Parent.Closed.Value
local Closed = true -- This line is removed after the 1st edit pretend like it isnt here
if Closed == true then
--do this if closed true
else
--do this if closed false
end
This might just be a small issue but I am not a genius when it comes to scripting, help greatly apprecieated.
[EDIT] : Due to some confusion I will be clearing up some things. Line 2 seems to be totally useless so I will be removing it. The script is not a Local Script, its a regular one. Let me explain what exactly I need from this script. I want that whenever a button is pressed In-Game the value "closed" will be changed. This Script is then supposed to change something judging on whenever the Value is changed to true or false. I've implemented a Button into my game that LITERALLY changes the Value in question when its clicked. And this script does nothing, altough its supposed to "do this if closed true". Instead it sticks to whatever the Value was when the test of the game was started.

2 comments
is it in a local script or server script?
im not sure why you have two 'Closed' variables