i found this door script that opens two doors when the player is near, but how would i go about changing it from seeing if the player is near to just the player clicking a button and the doors opening?
script:
local Open = false
local Radius = 10
function MoveDoors(mod)
for i = 1, 10 do
script.Parent.DoorA.Mesh.Scale = script.Parent.DoorA.Mesh.Scale + Vector3.new(-.1 * mod, 0, 0)
script.Parent.DoorB.Mesh.Scale = script.Parent.DoorB.Mesh.Scale + Vector3.new(-.1 * mod, 0, 0)
script.Parent.DoorA.Mesh.Offset = script.Parent.DoorA.Mesh.Offset + Vector3.new(.2 * mod, 0, 0)
script.Parent.DoorB.Mesh.Offset = script.Parent.DoorB.Mesh.Offset + Vector3.new(-.2 * mod, 0, 0)
wait()
end
script.Parent.DoorA.CanCollide = mod == -1
script.Parent.DoorB.CanCollide = mod == -1
end
while wait(.5) do
local openning = false
for _, v in pairs(game.Players:GetPlayers()) do
if v:DistanceFromCharacter(script.Parent:GetModelCFrame().p) < Radius then
openning = true
end
end
if openning and not Open then
MoveDoors(1)
Open = true
elseif not openning and Open then
Open = false
MoveDoors(-1)
end
end

5 comments
I used the script for a reason, it uses the meshes in the parts to resize them, creating a sliding effect, id rather have a smooth sliding door than an instant one
ok, i don't know how to do it that way so i put my method! I hope you find the answer your looking for!
https://scriptinghelpers.org/questions/80905/how-would-i-make-a-brick-like-slide-so-like-the-size-would-change
thanks but im asking how do i rewrite the script i provided so that instead of having the player near the door for it to open, i want it to use a click detector
in my opinion, making a new one would be easier, plus do YOU understand what the script is saying?