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

Simple Door Script not working?

Asked by 10 years ago
if game.Workspace.Game.Value == true then
    script.Parent.CanCollide = false
    script.Parent.Transparency = 1
end

I want when a BoolValue is turned to true then a door opens. I'm not sure if their needs to be something to check to see if the boolValue changes

2 answers

Log in to vote
1
Answered by 10 years ago


function Changed() if game.Workspace.Game.Value == true then script.Parent.CanCollide = false script.Parent.Transparency = 1 end end game.Workspace.Game.Changed:connect(Changed)
0
Thanks soo much :D NinjoOnline 1146 — 10y
Ad
Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
10 years ago
workspace.Game.Changed:connect(function()
    script.Parent.CanCollide=not workspace.Game.Value
    script.Parent.Transparency=workspace.Game.Value and 1 or 0
end)

Sets script.Parent.CanCollide to the opposite of workspace.Game.Value and sets the Transparency correspondingly.

Answer this question