Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Part in model Transparency error?

Asked by 8 years ago
Edited 8 years ago
Values = game.Workspace.Values.Value
script.Parent.MouseButton1Down:connect(function()
    if Values.OfficeDoorV.Value == "Closed"
        and Values.Obscure == "Visible"
        then game.Workspace.OfficeDoor.DoorFrame.Barrier.Transparency = 0
        game.Workspace.OfficeDoor.DoorFrame.Barrier.CanCollide = true
        Values.OfficeDoorV.Value = "Obscure"
        print("Obscure")
    elseif
        Values.OfficeDoorV.Value == "Open"
        and Values.Obscure == "Obscure"
        then game.Workspace.OfficeDoor.DoorFrame.Barrier.Transparency = 1
        game.Workspace.OfficeDoor.DoorFrame.Barrier.CanCollide = false
        print("Visible")
    end
end

The code leaves no errors, and yet does not function. Kind of irritating. If you know anything please point out where I goofed.

0
Can you post the error message here? patrline5599 150 — 8y
0
It doesnt print anything. Output is unchanged. SinsofFallenGods 50 — 8y
0
I see you're not settign Values.Obscure to "Visible" in the elseif branch. Could that have something to do with it? Also, you're not using the 'Value' member of 'Values.Obscure' in your comparison. Use 'Values.Obscure.Value' instead. honeygold13843 136 — 8y

1 answer

Log in to vote
0
Answered by
systack 123
8 years ago

I'm going to assume it's because you're checking if an object is equal to a string at line 4 and eleven, and you aren't properly changing the values to reflect the door's status

Values = game.Workspace.Values.Value
script.Parent.MouseButton1Down:connect(function()
    if Values.OfficeDoorV.Value == "Closed"
        and Values.Obscure.Value == "Visible"
        then game.Workspace.OfficeDoor.DoorFrame.Barrier.Transparency = 0
        game.Workspace.OfficeDoor.DoorFrame.Barrier.CanCollide = true
        Values.OfficeDoorV.Value = "Open"
    Values.Obscure.Value ="Obscure"
        print("Obscure")
    elseif
        Values.OfficeDoorV.Value == "Open"
        and Values.Obscure.Value == "Obscure"
        then game.Workspace.OfficeDoor.DoorFrame.Barrier.Transparency = 1
        game.Workspace.OfficeDoor.DoorFrame.Barrier.CanCollide = false
    Values.OfficeDoorV.Value = "Closed"
    Values.Obscure.Value ="Visible"
        print("Visible")
    end
end
Ad

Answer this question