Obby course

Models · by Brixborg

A whole five-stage obstacle course: stepping stones, spinning bars, a jump pad, a blinking bridge and a climb to the finish, over lava, with checkpoints and a stage leaderboard. Scripts inside.

Use it in your games: in the studio, open View > Archive, go to the Models shelf and pick "Obby course".

The script

-- Keeps this arm turning, and knocks away anyone it hits.
local arm = script.Parent
local SPEED = 1.8      -- how fast it turns (negative = the other way)
local KNOCK = 55      -- how hard it knocks you

local middle = arm.Position
local angle = 0

arm.Touched:connect(function(hit)
  local character = hit.Parent
  local torso = character and character:FindFirstChild("Torso")
  if torso and character:FindFirstChild("Humanoid") then
    -- Push them straight away from the middle of the spinner, and up a bit.
    local away = (torso.Position - middle) * Vector3.new(1, 0, 1)
    if away.magnitude > 0.1 then
      torso.Velocity = away.unit * KNOCK + Vector3.new(0, 25, 0)
    end
  end
end)

while true do
  angle = angle + SPEED * wait()
  arm.CFrame = CFrame.new(middle) * CFrame.Angles(0, angle, 0)
end

More models