Hi! I got a script from toolbox and modified it and I am having some problems with… more info:
Video showing the problem
Explorer printscreen
Script
local Hinge = script.Parent.Parent.Parent.Hinge
local Open = false
local Debounce = false
script.Parent.MouseClick:Connect(function(Player)
if Player.Backpack:FindFirstChild("Key") then
if Debounce == false then
if Open == false then
Open = true
Debounce = true
for i = 1, 26, 1 do
script.Parent.Parent.Parent:SetPrimaryPartCFrame(script.Parent.Parent.Parent:GetPrimaryPartCFrame(Hinge.Position) * CFrame.Angles(0,math.rad(4),0,0) * CFrame.new(0,0,0))
wait()
end
Debounce = false
elseif Open == true and Debounce == false then
for i = 1, 26, 1 do
script.Parent.Parent.Parent:SetPrimaryPartCFrame(script.Parent.Parent.Parent:GetPrimaryPartCFrame(Hinge.Position) * CFrame.Angles(0,math.rad(-4),0,0) * CFrame.new(0,0,0))
wait()
Open = false
Debounce = true
end
Debounce = false
end
end
end
end)
Thanks