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

Trying to script simple door but the script wont work for some reason, any ideas?

So I am doing a simple door. The idea is having two types of doors placed. Open version and closed one. the open version of the door is transparent and have turned off collisions, closed doors have it the other way. What I am doing is having click detector in the door part, and a script which checks if the click decetor has been clicked. If yes it will make collisions false and transaprency 1 for the closed doors, and turn on collisions and transparency to 0 for the opened door. The problem is that when i click the doors, it makes the closed doors transparent and collisons turned off which is what i want BUT the opened doors version doesnt get visible nor collisons turned on, here is script I use for both of the door.:

function onClicked()
	script.Parent.Parent.door1.Transparency = 1
	script.Parent.Parent.door1.CanCollide = false
	script.Parent.Parent.door2.Transparency =0
	script.Parent.Parent.door2.CanCollide = true
end
script.Parent.ClickDetector.MouseClick:connect (onClicked)

Explorer window

2 answers

try deleting the script in door2 and then do

script.Parent.ClickDetector.MouseClick:Connect(function()
	script.Parent.Transparency = 1
	script.Parent.CanCollide = false
	script.Parent.Parent.door2.Transparency = 0
	script.Parent.door2.CanCollide = true
end)

if that doesn't work too then dm me on discord:

#BlueDuck#8702

6 comments

0

nah still dont work

0

also I tried to dm you but it tells me that noone with this name and tag exists

0

try Blue Duck#8902

0

do you see any errors on the output have you tried debugging?

0

That works, I sent you friend request bcs I cant msg you till you accept it

0

I didnt see any errors and I dont know how to debugg

The door were not anchored :D When I anchored them, it worked correctly

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