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

Door won't disappear after I click?

Okay what I'm trying to do is have a tool "listen" for a click and then take appropriate action as suggested by a user named "yumtaste" (in this case, it's making a door fade). For some reason, it does not work. The following script is inserted into the tool

local door = game.Workspace.BigDoor
script.Parent.Equipped:connect(function(mouse)
if mouse.Target then
if mouse.Target == door then
        for i = 1, 10 do

            door.Transparency = door.Transparency + .05

            wait(.1)

        end
wait(10)
door.Transparency = 0.5

end
end
end)

The following script is inserted into the door

if script.Parent.Transparency == 0 then
script.Parent.CanCollide = false
else
script.Parent.CanCollide = true
end

Does anyone see the problem?

1 answer

add this to your script instead of the mouse target what mouse target does is it waits until your mouse is hovering over the door then it proceeds but this listens for that click. Put it in a localscript also

mouse.Button1Down:connect(function()
--code
end)

2 comments

0

I'm confused, do I replace lines 2-4 with this?

0

lines 3-4

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