Hello, I have been working on a game similar to Doors and other similar games. When making a chase sequence I wanted the door behind the player to close when the player ended the chase.
Here is some things about the doors in my game.
- The doors are controlled by a module script that is always called by the server
- The doors can be opened and closed by changing the number value named “open”
- To close the door the “open” value must be 0
This system works fine with other rooms in my game except the chase ending. The number value changes for other rooms but doesn’t with the chase ending. Instead the value will stay the same.
Here is the code I used for BOTH the chase and other rooms.
-- used for other rooms
GeneratedRooms[EnterCount - 1]:FindFirstChild("Door"):FindFirstChild("open").Value = 0
-- used for chase ending (practically the same)
GeneratedRooms[EnterCount - 2]:FindFirstChild("Door"):FindFirstChild("open").Value = 0
This is the code that runs once the chase ends.
game.Lighting.ExposureCompensation = -2
GeneratedRooms[EnterCount - 1]:FindFirstChild("Door"):FindFirstChild("open").Value = 0
monster:Destroy()
SoundHandler.ChangeSettings("Chase", nil, nil, 109)
remoteEvents.PlayerData:FireAllClients(16)
All of this runs perfectly with no errors but the number value in the door does not change.
I suspect there is something interfering with the values but I am not sure. I would really appreciate some explanation. (btw I wrote this really late so I’m sorry if it sound kinda unclear)