Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local blockfolder = Instance.new("Folder",script)
- blockfolder.Name = "blockfolder"
- local heighthint = Instance.new("Hint",script)
- debris = game:GetService("Debris")
- tween = game:GetService("TweenService")
- local oldpos = Vector3.new(0,-2,10)
- local lasthit = Vector3.new(0,0,0)
- local untouched = 0
- local touched = {}
- local function createpos(r1,r2)
- local v1,v2,v3 = 0,0,0
- if math.random(1,2) == 1 then
- v1 = -math.random(r1,r2)
- else
- v1 = math.random(r1,r2)
- end
- if math.random(1,2) == 1 then
- v2 = -math.random(r1,r2)
- else
- v2 = math.random(r1,r2)
- end
- if math.random(1,2) == 1 then
- v3 = -math.random(r1,r2)
- else
- v3 = math.random(r1,r2)
- end
- return v1,v2,v3
- end
- local function Number(num)
- local UseText = ""
- local StoredScore = num
- local Thousand = false
- for i = 1,StoredScore / 1000 do
- Thousand = true
- StoredScore = StoredScore - 1000
- UseText = UseText.." TH"
- end
- if Thousand then
- UseText = UseText..[[
- ]]
- end
- local Hundred = false
- for i = 1,StoredScore / 100 do
- Hundred = true
- StoredScore = StoredScore - 100
- UseText = UseText.." H"
- end
- if Hundred then
- UseText = UseText..[[
- ]]
- end
- local Ten = false
- for i = 1,StoredScore / 10 do
- Ten = true
- StoredScore = StoredScore - 10
- UseText = UseText.." T"
- end
- if Ten then
- UseText = UseText..[[
- ]]
- end
- for i = 1,StoredScore do
- StoredScore = StoredScore - 1
- UseText = UseText.." I"
- end
- UseText = UseText.." "
- return UseText
- end
- function sleep(n)
- task.wait(n or 0)
- end
- function wrap(func)
- coroutine.wrap(func)()
- end
- function restart(amount)
- local rehint = Instance.new("Hint",script)
- rehint.Text = 'restarting game..'
- debris:AddItem(rehint,amount)
- local timer = amount
- heighthint = "" .. Number(timer)
- wrap(function()
- for i = 1,amount do
- sleep(1)
- timer = timer - 1
- heighthint = "" .. Number(timer)
- end
- end)
- sleep(amount)
- if math.random(1,2) == 1 then
- race(1000,false)
- else
- endless(math.pow(100,100),true)
- end
- end
- local function createblock(par,col,can,anc,pos,mode,buff)
- local part,hitbox,hurt
- if mode == 'normal' then
- part = Instance.new("Part",par)
- part.Anchored = anc
- part.CanCollide = can
- part.Position = pos
- part.Material = Enum.Material.Pebble
- part.Color = col
- part.Size = Vector3.new(7,.5,7)
- part.Locked = true
- elseif mode == 'spin1' then
- part = Instance.new("Part",par)
- part.Anchored = anc
- part.CanCollide = can
- part.Position = pos
- part.Material = Enum.Material.Pebble
- part.Color = col
- part.Size = Vector3.new(7,.5,7)
- part.Locked = true
- hitbox = Instance.new("SelectionBox",part)
- hitbox.Adornee = part
- hitbox.LineThickness = .1
- hitbox.SurfaceTransparency = .5
- hitbox.Color3 = Color3.new(0,0,1)
- part.RotVelocity = Vector3.new(0,3,0)
- wrap(function()
- while sleep() do
- part.CFrame = part.CFrame*CFrame.Angles(0,.1,0)
- end
- end)
- elseif mode == 'spin2' then
- part = Instance.new("Part",par)
- part.Anchored = anc
- part.CanCollide = can
- part.Position = pos
- part.Material = Enum.Material.Pebble
- part.Color = col
- part.Size = Vector3.new(7,.5,7)
- part.Locked = true
- hitbox = Instance.new("SelectionBox",part)
- hitbox.Adornee = part
- hitbox.LineThickness = .1
- hitbox.SurfaceTransparency = .5
- hitbox.Color3 = Color3.new(0,1,1)
- part.RotVelocity = Vector3.new(0,-3,0)
- wrap(function()
- while sleep() do
- part.CFrame = part.CFrame*CFrame.Angles(0,-.1,0)
- end
- end)
- elseif mode == 'win' then
- part = Instance.new("Part",par)
- part.Anchored = anc
- part.CanCollide = can
- part.Position = pos
- part.Material = Enum.Material.Neon
- part.Size = Vector3.new(7,.5,7)
- part.Locked = true
- wrap(function()
- while true do
- part.Color = Color3.new(1,0,0)
- sleep(0.25)
- part.Color = Color3.new(1,1,0)
- sleep(0.25)
- part.Color = Color3.new(1,1,1)
- sleep(0.25)
- part.Color = Color3.new(0,1,1)
- sleep(0.25)
- part.Color = Color3.new(0,0,1)
- sleep(0.25)
- end
- end)
- end
- if buff == 'hurt' then
- hurt = Instance.new("Sound",part)
- hurt.SoundId = "rbxassetid://3362346832"
- hurt.Volume = 0.5
- if hitbox and hitbox.Parent then
- hitbox:Destroy()
- end
- hitbox = Instance.new("SelectionBox",part)
- hitbox.Adornee = part
- hitbox.LineThickness = .1
- hitbox.SurfaceTransparency = .5
- hitbox.Color3 = Color3.new(255/255,152/255,220/255)
- part.Touched:Connect(function(obj)
- if obj.Parent.ClassName == "Model" then
- local hum = obj.Parent:FindFirstChildOfClass("Humanoid")
- if hum and hum.Parent and not hum:FindFirstChild("platform poison") then
- local confirm = Instance.new("IntValue",hum)
- confirm.Name = 'platform poison'
- debris:AddItem(confirm,.25)
- hurt:Play()
- hum.Health = hum.Health - (hum.MaxHealth/50)
- end
- end
- end)
- end
- untouched = untouched + 1
- return part
- end
- function create_sound(par,id,vol)
- local s = Instance.new("Sound")
- s.SoundId = "rbxassetid://" .. id
- s.Volume = vol or 0.5
- s.Parent = par or script
- return s
- end
- local win_s = create_sound(script,142389573,0.5)
- function race(height,hardcore)
- local ended = false
- oldpos = Vector3.new(0,-2,10)
- lasthit = Vector3.new(0,0,0)
- local starthint = Instance.new("Hint",script)
- wrap(function()
- starthint.Text = 'Mode: Race (get to the end and finish the race!)'
- sleep(5)
- win_s:Stop()
- create_sound(script,178029826,0.5):Play()
- starthint.Text = 'starting in III'
- sleep(1)
- starthint.Text = 'starting in II'
- sleep(1)
- starthint.Text = 'starting in I'
- sleep(1)
- starthint.Text = 'GO!'
- end)
- debris:AddItem(starthint,9)
- sleep(9)
- wrap(function()
- while not ended do
- sleep(1)
- if ended then return end
- if height > oldpos.Y then
- heighthint.Text = [[
- Height:
- ]] .. tostring(Number(oldpos.Y))
- --print(oldpos.Y)
- end
- end
- end)
- while height > oldpos.Y do
- repeat sleep() until 8 > untouched
- sleep(0.5)
- local v1,v2,v3 = createpos(7,8)
- local pos = oldpos + Vector3.new(v1,8,v2)
- oldpos = pos
- local block
- if hardcore then
- if math.random(1,5) == 3 then
- if math.random(1,5) == 2 then
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'spin1','hurt')
- else
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'spin1','default')
- end
- elseif math.random(1,5) == 2 then
- if math.random(1,5) == 2 then
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'spin2','hurt')
- else
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'spin2','default')
- end
- else
- if math.random(1,5) == 2 then
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'normal','hurt')
- else
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'normal','default')
- end
- end
- else
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'normal','default')
- end
- create_sound(block,225320558,0.5):Play()
- local touched = false
- block.Touched:Connect(function(obj)
- if not touched then
- local hum = obj.Parent:FindFirstChildOfClass("Humanoid")
- local Above = false
- local blocks = blockfolder:GetChildren()
- for i = 1,#blocks do
- if blocks[i]:IsA("BasePart") and blocks[i].Material ~= Enum.Material.SmoothPlastic and blocks[i].Material ~= Enum.Material.Neon and blocks[i].Position.Y < block.Position.Y then
- Above = true
- end
- end
- if not Above and block.Material ~= Enum.Material.SmoothPlastic and block.Material ~= Enum.Material.Neon and obj and obj.Parent and hum and hum.Parent and obj.Parent.ClassName == "Model" then
- touched = true
- untouched = untouched - 1
- lasthit = block.Position
- block.Material = Enum.Material.SmoothPlastic
- block.Color = Color3.new(0,1,0)
- elseif Above and obj and obj.Parent and obj.Parent.ClassName == "Model" then
- obj.Parent:TranslateBy(Vector3.new(0,-360,0))
- obj.Parent:BreakJoints()
- end
- end
- end)
- end
- repeat sleep() until 8 > untouched
- sleep(0.5)
- local v1,v2,v3 = createpos(7,8)
- local pos = oldpos + Vector3.new(v1,8,v2)
- oldpos = pos
- local block = createblock(blockfolder,nil,true,true,pos,'win')
- create_sound(block,225320558,0.5):Play()
- local touched = false
- block.Touched:Connect(function(obj)
- if not touched then
- local hum = obj.Parent:FindFirstChildOfClass("Humanoid")
- local Above = false
- local blocks = blockfolder:GetChildren()
- for i = 1,#blocks do
- if blocks[i]:IsA("BasePart") and blocks[i].Material ~= Enum.Material.SmoothPlastic and blocks[i].Material ~= Enum.Material.Neon and blocks[i].Position.Y < block.Position.Y then
- Above = true
- end
- end
- if not Above and obj and obj.Parent and obj.Parent.ClassName == "Model" then
- touched = true
- untouched = untouched - 1
- lasthit = block.Position
- win_s:Play()
- wrap(function()
- for i,v in pairs(blockfolder:GetChildren()) do
- sleep(.075)
- v.Anchored = false
- debris:AddItem(v,10)
- end
- end)
- wrap(function()
- local winhint = Instance.new("Hint",script)
- winhint.Text = obj.Parent.Name .. ' Has won!'
- debris:AddItem(winhint,10)
- sleep(10)
- ended = true
- heighthint.Text = " "
- oldpos = Vector3.new(0,-2,10)
- lasthit = Vector3.new(0,0,0)
- restart(10)
- end)
- elseif Above and obj and obj.Parent and obj.Parent.ClassName == "Model" then
- obj.Parent:TranslateBy(Vector3.new(0,-360,0))
- obj.Parent:BreakJoints()
- end
- end
- end)
- end
- function endless(hardcore)
- local height = 1/0
- local ended = false
- oldpos = Vector3.new(0,-2,10)
- lasthit = Vector3.new(0,0,0)
- local starthint = Instance.new("Hint",script)
- wrap(function()
- starthint.Text = 'Mode: Endless (do your best i guess lol)'
- sleep(5)
- win_s:Stop()
- create_sound(script,178029826,0.5):Play()
- starthint.Text = 'starting in III'
- sleep(1)
- starthint.Text = 'starting in II'
- sleep(1)
- starthint.Text = 'starting in I'
- sleep(1)
- starthint.Text = 'GO!'
- end)
- debris:AddItem(starthint,9)
- sleep(9)
- wrap(function()
- while not ended do
- sleep(1)
- if ended then return end
- if height > oldpos.Y then
- heighthint.Text = [[
- Height:
- ]] .. tostring(Number(oldpos.Y))
- --print(oldpos.Y)
- end
- end
- end)
- while height > oldpos.Y do
- repeat sleep() until 8 > untouched
- sleep(0.5)
- local v1,v2,v3 = createpos(7,8)
- local pos = oldpos + Vector3.new(v1,8,v2)
- oldpos = pos
- local block
- if hardcore and oldpos.Y >= 1000 then
- if math.random(1,3) == 3 then
- if math.random(1,5) == 2 then
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'spin1','hurt')
- else
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'spin1','default')
- end
- elseif math.random(1,3) == 2 then
- if math.random(1,5) == 2 then
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'spin2','hurt')
- else
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'spin2','default')
- end
- else
- if math.random(1,5) == 2 then
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'normal','hurt')
- else
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'normal','default')
- end
- end
- elseif hardcore and oldpos.Y >= 3000 then
- if math.random(1,2) == 1 then
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'spin1','hurt')
- else
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'spin2','hurt')
- end
- else
- block = createblock(blockfolder,Color3.new(1,1,1),true,true,pos,'normal','default')
- end
- create_sound(block,225320558,0.5):Play()
- local touched = false
- block.Touched:Connect(function(obj)
- if not touched then
- local hum = obj.Parent:FindFirstChildOfClass("Humanoid")
- local Above = false
- local blocks = blockfolder:GetChildren()
- for i = 1,#blocks do
- if blocks[i]:IsA("BasePart") and blocks[i].Material ~= Enum.Material.SmoothPlastic and blocks[i].Material ~= Enum.Material.Neon and blocks[i].Position.Y < block.Position.Y then
- Above = true
- end
- end
- if not Above and block.Material ~= Enum.Material.SmoothPlastic and block.Material ~= Enum.Material.Neon and obj and obj.Parent and hum and hum.Parent and obj.Parent.ClassName == "Model" then
- touched = true
- untouched = untouched - 1
- lasthit = block.Position
- block.Material = Enum.Material.SmoothPlastic
- block.Color = Color3.new(0,1,0)
- wrap(function()
- sleep(10)
- block.Anchored = false
- debris:AddItem(block,10)
- end)
- wrap(function()
- local oldtouch = lasthit.Y
- sleep(10)
- if oldtouch == lasthit.Y then
- local warninghint = Instance.new("Hint",script)
- warninghint.Text = "Keep going this can't be the end!"
- debris:AddItem(warninghint,5)
- end
- sleep(5)
- if oldtouch == lasthit.Y then
- local warninghint = Instance.new("Hint",script)
- debris:AddItem(warninghint,5)
- warninghint.Text = "Game Ended!"
- ended = true
- heighthint.Text = " "
- oldpos = Vector3.new(0,-2,10)
- lasthit = Vector3.new(0,0,0)
- wrap(function()
- for i,v in pairs(blockfolder:GetChildren()) do
- sleep(.025)
- v.Anchored = false
- debris:AddItem(v,10)
- end
- end)
- restart(10)
- end
- end)
- elseif Above and obj and obj.Parent and obj.Parent.ClassName == "Model" then
- obj.Parent:TranslateBy(Vector3.new(0,-360,0))
- obj.Parent:BreakJoints()
- end
- end
- end)
- end
- end
- local mode = 0
- local hardcore = true
- if mode == 0 then
- race(1000,hardcore)
- elseif mode == 1 then
- endless(math.pow(100,100),hardcore)
- end
Add Comment
Please, Sign In to add comment