Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Simple Door Script not working?

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

✓ Accepted answer


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)

1 comment

0

Thanks soo much :D

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.