buttons = {"A","B","C","D"} locks = {"Lock1","Lock2"} parent = game.Workspace order = 0 function Unlock() print("U") local bf = Instance.new("BodyForce") for i = 1,#locks do local lock = parent:FindFirstChild(locks[i]) if lock ~= nil then coroutine.resume(coroutine.create(function() bf:Clone().Parent = lock lock.BodyForce.force = Vector3.new(-1e+006,1,0) wait(10) lock.BodyForce.force = Vector3.new(1e+006,1,0) wait(10) lock.BodyForce:Remove() end)) end end wait(20) for i = 1,#buttons do buttons[i].Stepped.Value = false end order = 0 end e = true function onTouched(hit,num) if not e then return end e = false print(num) local h = hit.Parent:FindFirstChild("Humanoid") if h ~= nil then local button = buttons[num] if not button.Stepped.Value then if order == num-1 then button.Stepped.Value = true order = num else local m = Instance.new("Message") m.Text = "You tripped and fell!" m.Parent = game.Players:GetPlayerFromCharacter(h.Parent) h.Health = 0 wait(5) m:Remove() end if order == 4 then Unlock() end end wait(2) end e = true end for i = 1,#buttons do local button = parent:FindFirstChild(buttons[i]) if button ~= nil then buttons[i] = button local bool = Instance.new("BoolValue") bool.Name = "Stepped" bool.Value = false bool.Parent = button button.Touched:connect(function(hit) onTouched(hit,i) end) end end