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

Tool that opens a door?

Asked by
tvfob 6
6 years ago

I need help with making a Sonic Screwdriver open a door. Any ideas?

1 answer

Log in to vote
0
Answered by
mattscy 3725 Moderation Voter Community Moderator
6 years ago

Something like this might work as an outline if it is in a LocalScript inside the tool and the door is a model called Door:

local mouse = game.Players.LocalPlayer:GetMouse()
script.Parent.Activated:Connect(function()
    local targ = mouse.Target
    if targ and targ.Parent.Name == "Door" then
        for _,v in pairs(targ.Parent:GetDescendants()) do
            if v:IsA("BasePart") then
                v.CanCollide = false
                v.Transparency = 0.5
            end
        end
    end
end)
Ad

Answer this question