local Workspace = game:GetService("Workspace") local ServerStorage = game:GetService("ServerStorage") local ObbyFolder = Instance.new("Folder", Workspace) ObbyFolder.Name = "GeneratedObby" local startPos = Vector3.new(0, 5, 0) local platformSize = Vector3.new(10, 1, 10) local gap = 12 local height = 0 local count = 15 -- number of stages local function createPlatform(position, color) local part = Instance.new("Part") part.Size = platformSize part.Anchored = true part.Position = position part.Color = color part.Parent = ObbyFolder return part end local function createKillBlock(position) local part = Instance.new("Part") part.Size = Vector3.new(10,1,10) part.Anchored = true part.Position = position part.Color = Color3.fromRGB(255,0,0) part.Name = "KillPart" part.Parent = ObbyFolder local scriptObj = Instance.new("Script", part) scriptObj.Source = [[ script.Parent.Touched:Connect(function(hit) local hum = hit.Parent:FindFirstChild("Humanoid") if hum then hum.Health = 0 end end) ]] end -- Spawn local spawn = Instance.new("SpawnLocation", Workspace) spawn.Position = startPos + Vector3.new(0,3,0) spawn.Size = Vector3.new(6,1,6) spawn.Anchored = true spawn.Transparency = 0.5 spawn.BrickColor = BrickColor.new("Bright green") spawn.Name = "Spawn" -- Mobile Controls Hint (for players using touch devices) local hint = Instance.new("Part") hint.Size = Vector3.new(20,1,10) hint.Anchored = true hint.Position = startPos + Vector3.new(0, 10, 5) hint.Transparency = 0.7 hint.BrickColor = BrickColor.new("Bright yellow") hint.Name = "MobileControlsHint" hint.Parent = ObbyFolder local hintGui = Instance.new("BillboardGui", hint) hintGui.Size = UDim2.new(0, 200, 0, 50) hintGui.StudsOffset = Vector3.new(0,2,0) hintGui.AlwaysOnTop = true local textLabel = Instance.new("TextLabel", hintGui) textLabel.Size = UDim2.new(1,0,1,0) textLabel.BackgroundTransparency = 1 textLabel.Text = "Use screen buttons to move & jump!" textLabel.TextScaled = true textLabel.TextColor3 = Color3.new(0,0,0) -- Generate Obby for i = 1, count do local pos = startPos + Vector3.new(0, height, -i * gap) if i % 5 == 0 then createKillBlock(pos) else createPlatform(pos, Color3.fromRGB(255 - i*10, 255, 255 - i*5)) end end -- Finish part local finish = Instance.new("Part") finish.Size = Vector3.new(12, 1, 12) finish.Anchored = true finish.Position = startPos + Vector3.new(0, height, -(count+2)*gap) finish.Color = Color3.fromRGB(0, 255, 0) finish.Name = "Finish" finish.Parent = ObbyFolder local finishScript = Instance.new("Script", finish) finishScript.Source = [[ script.Parent.Touched:Connect(function(hit) local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr then print(plr.Name .. " finished the obby!") end end) ]]