Загрузка данных


local button = script.Parent
local model = button.Parent
local hinge = model.platform.HingeConstraint

local isOpen = false
local isCooldown = false

local function hit(otherPart)
	local character = otherPart.Parent
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	
	if humanoid and not isCooldown then
		isCooldown = true
		
		if not isOpen then
			hinge.TargetAngle = -90
			isOpen = true
		else
			hinge.TargetAngle = 0
			isOpen = false
		end
		
		task.wait(2)
		isCooldown = false
	end
end

button.Touched:Connect(hit)