Not sure what's wrong with this attribute script?

  1. What do you want to achieve? Keep it simple and clear!
    I’m attempting to script a door that, when clicked, changes the bool to true/false
  2. What is the issue? Include screenshots / videos if possible!

    Here’s an image of the code
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve been browsing the devforum in hopes to find something similar, but I haven’t found anything yet.

Not really sure what I’m doing wrong, I’m using to using BoolValue’s but I’d like to upgrade to Attributes. Sorry if this is a stupid fix! :sweat_smile:

It should read
if TARDIS:GetAttribute("RightDoor") == false then
or, more preferred in this case,
if not TARDIS:GetAttribute("RightDoor") then

2 Likes

Thank you very much! Two days of searching for such a simple answer! :sweat_smile:

The problem is that it sets the attribute to true if it is true, and false if it is false. You want to toggle this attribute (set to true if false, false if true), so you would swap the if and the else statements