Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- ok man look, you people who approve applications of programming told me to give you a minimum of 200 lines script. Then told me to add more comments, okay so ill add comments for this script until line 300, happy? This is one of the source codes for the game "zq's sansbox"(im changing it to untitled sansbox in the future) as you can see from the previous applications i posted this same script, and this script has more lines than the previous one so this should show i worked on the script.
- this script is one of the source code of a script in zq's sansbox. Please do not redistribute.
- This is a solo project I was working on and thought I could post this to the applications.
- - zqozr_II
- ]]
- local phases = { -- phases and details for phrases for what'll the boss say. (later on i just did it manually so ill deprecate this soon)
- first = {
- start = 2; -- starts attacking after x seconds
- firstspeech = [[Your life.. may end up in a high place]];
- secondspeech = [[ ____]];
- thirdspeech = [[Show me your resolve.]];
- fourthspeech = [[This is just the beginning____ it might not look too good for you won't it now?.]];
- fifthspeech = [[I was sure I made that decently fast._ ]];
- };
- second = {
- firstspeech = [[I slacked around too much, it's time to end.. this ]];
- secondspeech = [[Do you feel your demise!?____]];
- thirdspeech = [[Could it get worse?]];
- fourthspeech = [[Struggling? I still have 200 moves left.]];
- fifthspeech = [[I haven't started combining my attacks yet.]];
- sixthspeech = [[Can you really survive this one?]];
- seventhspeech = [[That was alright. But my strongest attacks would be nothing compared to that.]]
- -- the next speeches will be manually inputed for now
- };
- third = {
- };
- fourth = {
- };
- fifth = {
- };
- }
- local maxhealth = 100
- local bosshealth = 100
- for _, v in pairs(script.Parent:GetChildren()) do -- i placed templates for the attacks, since I want them to be visible in studio I have to set their visibility in game.
- if string.match(v.Name:lower(), 'template') then
- v.Visible = false
- end
- end
- local timestopped = false -- a lot of variables will start from this line, yes I worked on misc abilities instead of giving the boss more phases
- local fpsunlockerDisabled = true
- local infinity = false -- an anime ability from gojo satoru "infinity" from the anime 'jujutsu kaisen'.
- local spectateenabled = true
- local rawtick = tick
- local tick = os.time
- local tweens = {}
- local realtweenservice = game:GetService('TweenService')
- local start = tick()
- local plr = game:GetService('Players').LocalPlayer
- local leaderstats = plr:WaitForChild('leaderstats')
- local deaths = leaderstats:WaitForChild('deaths')
- local rs = game:GetService('ReplicatedStorage')
- local collisionservice = require(rs:WaitForChild('GuiCollisionService'))
- local dragservice = require(rs:WaitForChild('DraggableObject'))
- local mouse = plr:GetMouse()
- local tweenservice = game:GetService('TweenService')
- local tweenservice = {}
- function tweenservice:Create(...) -- by simply tampering with tweenservice functions we can record them, and easily tampering with tweenservice functions without having to change the other 800 lines of the script. This helps with the "infinity" ability and the "timestop" ability.
- local tween = realtweenservice:Create(...)
- local insert = {}
- local object = ({...})[1]
- local tweeninfo = ({...})[2]
- local propertytable = ({...})[3]
- insert.tween = tween
- insert.waspaused = false
- insert.frame = object
- insert.tweeninfo = tweeninfo
- insert.propertytable = propertytable
- insert.tweencreatedon = tick()
- table.insert(tweens, insert)
- tween.Completed:Once(function() -- could this parameter be expensive?
- local find = table.find(tweens, insert)
- if find then
- table.remove(tweens, find)
- end
- end)
- return tween
- end
- local uis = game:GetService('UserInputService')
- local remote = rs:WaitForChild('all')
- local isStudio = game:GetService('RunService'):IsStudio() -- made this variable so that if we're in studio then enable all admin abilities for everyone
- local background = script.Parent.Background
- local border = script.Parent.Border
- local cursor = script.Parent.cursor
- local bordervisual = script.Parent.BorderVisual
- local dialogue = script.Parent.Dialogue
- local phase = script.Parent.Phase
- local infinityhitbox = script.Parent.infinityhitbox
- local rswait = function(x: 'wait time', stoppable: 'this can yield if time is stopped?') -- helps with timestop, and is almost as efficient as task.wait
- if x>0 then
- --[[
- local z = rawtick()
- repeat game:GetService('RunService').RenderStepped:Wait() until rawtick()>=z+x
- ]]
- local delta = 0
- repeat if stoppable and timestopped==true then
- game:GetService('RunService').RenderStepped:Wait()
- else
- delta+=game:GetService('RunService').RenderStepped:Wait()
- end
- until delta>=x
- else
- if stoppable and timestopped then
- repeat game:GetService('RunService').RenderStepped:Wait() until timestopped == false
- else
- game:GetService('RunService').RenderStepped:Wait()
- end
- end
- end
- local group = collisionservice.createCollisionGroup()
- local godmode = false
- local ultrainstinct = false
- group:setZIndexHierarchy(true)
- group:addCollider(border, true)
- group:addCollider(cursor, true)
- uis.MouseIconEnabled = false
- local lastposition = nil
- local lastpositions = {}
- local v2 = Vector2.new
- local abs = math.abs
- local oldmouseaxis = v2(0, 0)
- local cursorcanmove = true
- local function randomletter(amount)
- local str = ''
- for i = 1, amount, 1 do
- str = str.. string.char(97+math.random(0,25))
- end
- return str
- end
- local function randomnumber(digits)
- local num = ''
- for i = 1, digits, 1 do
- num = num .. math.random(1, 10)
- end
- return num
- end
- local function writeText(text, charname)
- local basetext = charname or '???: ' -- if charname then charname else '???:'
- for i = 1, string.len(text), 1 do
- local letter = string.sub(text, i, i)
- if letter~='_' then
- basetext = basetext.. letter
- local soundclone = workspace:WaitForChild('sanstalk'):Clone()
- soundclone.Parent = workspace
- soundclone:Play()
- game:GetService('Debris'):AddItem(soundclone, 1.1)
- dialogue.Text = basetext
- end
- if letter == '.' or letter == '_' then
- --[[
- for z = 1,15,1 do
- game:GetService('RunService').RenderStepped:Wait()
- end
- ]]
- rswait(0.23)
- else
- --[[
- for i = 1, 3, 1 do
- game:GetService('RunService').RenderStepped:Wait()
- game:GetService('RunService').RenderStepped:Wait()
- game:GetService('RunService').RenderStepped:Wait()
- end
- ]]
- rswait(0.06)
- end
- end
- end
- local function simulatehit(position, targethit) -- check if the cursor will still collide in this position
- local viewport = workspace.CurrentCamera.ViewportSize
- local check = cursor:Clone()
- check.Name='CURSORCHECK'
- check.Transparency = 1
- check.Position = UDim2.new(position.X/viewport.X-(check.Size.X.Scale/2), 0, position.Y/viewport.Y+(check.Size.Y.Scale/2), 0)
- check.Parent = script.Parent
- local boolvalue = collisionservice.isColliding(check, targethit) or (collisionservice.isInCore(targethit, check) or collisionservice.isInCore(check, targethit))
- check:Destroy()
- return boolvalue
- --[[
- local index = group:addCollider(check, true)
- local boolvalue = collisionservice.isc
- task.delay(0.1, function()
- group:removeCollider(index)
- check:Destroy()
- end)
- ]]
- end
- local function cursordistancefrommouse() -- i made this function so that in the future I can make the cursor heart ui to tween position to my mouse. Since the cursor gui follows the mouse it can teleport if the mouse suddenly travels a large distance by exiting the roblox window and placing your mouse elsewhere
- local viewport = workspace.CurrentCamera.ViewportSize
- local vector2distance = v2(abs(cursor.Position.X.Scale-mouse.X/viewport.X), abs(cursor.Position.Y.Scale-mouse.Y/viewport.Y))
- return vector2distance, vector2distance.Magnitude
- end
- local function shakecursor(shakes)
- cursorcanmove = false
- local cursorposition = cursor.Position
- local oldcolor = cursor.BackgroundColor3
- cursor.BackgroundColor3 = Color3.fromRGB(138, 0, 10)
- for i = 1, shakes*2, 1 do
- local random = Random.new()
- cursor.Position = cursorposition + UDim2.new(random:NextNumber(-0.05, 0.05), 0, random:NextNumber(-0.065, 0.065), 0)
- if i%2 == 0 then -- even number
- cursor.Rotation = 10
- else -- odd number
- cursor.Rotation = -10
- end
- game:GetService('RunService').RenderStepped:Wait()
- end
- cursor.BackgroundColor3 = oldcolor
- cursor.Rotation = 0
- cursorcanmove = true
- end
- local function checkframerate() -- my simple, fast & easy way of checking framerate. It'll show how much times renderstepped got fired in just 1 second, average is 60 frames per second and they're using fps unlocker if it goes above 65.
- local x = tick()
- local x2 = 0
- repeat x2+=1 game:GetService('RunService').RenderStepped:Wait() until (tick()-x)>=1
- return x2
- end
- local rendersteppedconnect
- local function death()
- game:GetService('StarterGui'):SetCore('SendNotification', {
- Title = ':(';
- Text = "You died. Automatically respawned";
- })
- rendersteppedconnect:Disconnect()
- remote:FireServer('dead')
- _G.restart()
- end
- local previous60frames = {} -- i was planning to use this for optimizing the spectating feature but ehhh nevermind, it was still the same since client fireservers a table with like a fifty to hundred kilobytes every second? I'm disappointed roblox struggles with sending that much oh well
- rendersteppedconnect = game:GetService('RunService').RenderStepped:Connect(function()
- local viewport = workspace.CurrentCamera.ViewportSize
- local targetposition = UDim2.new(mouse.X/viewport.X-(cursor.Size.X.Scale/2), 0, mouse.Y/viewport.Y+(cursor.Size.Y.Scale/2), 0)
- if not lastposition then
- lastposition = targetposition
- oldmouseaxis = v2(mouse.X, mouse.Y)
- end
- local function borderadjust() -- this is just to prevent the cursor ui from following to mouse through the border.
- -- repeat cursor.Position = cursor.Position - UDim2.new(0, 0, 0.01, 0) until cursor.Position.Y.Scale<=border.Position.Y.Scale-border.Size.Y.Scale/2
- if not simulatehit(Vector2.new(mouse.X, mouse.Y), border) then
- local vector2, distance = cursordistancefrommouse()
- --[[
- if targetposition.Y.Scale<=border.Position.Y.Scale+border.Size.Y.Scale/2 then
- cursor.Position = lastposition
- return
- else
- cursor.Position = targetposition
- warn('free')
- end
- ]]
- cursor.Position = targetposition
- else
- cursor.Position = UDim2.new(targetposition.X.Scale, 0, bordervisual.Position.Y.Scale+bordervisual.Size.Y.Scale/1.05, 0)
- return true
- end
- end
- if spectateenabled == true then
- if rs.hosts:FindFirstChild(plr.Name) then
- local input = {}
- local function class(name, pos, size)
- local new = {}
- new[1] = name
- new[2] = pos
- new[3] = size or Vector3.new(0,0,0)
- table.insert(input, new)
- end
- for i, v in pairs(script.Parent:GetChildren()) do
- if v.Name == 'dangerframe' then
- class('dangerframe', v.Position, v.Size)
- elseif v.Name == 'cursor' then
- class('cursor', v.Position, v.Size)
- end
- end
- rs.hosts[plr.Name]:FireServer('spectateinfo', input) -- rs.hosts[plr.Name]:FireServer('spectateinfo', unpack(input)) -- simple spectate feature, i didn't optimize it and lazily placed everything in 1 go, the lag isn't that bad tho and since this is a local script lag won't affect your gameplay.
- end
- end
- if godmode == false then
- if infinity == true then
- local collisions = {}
- local noncollide = {}
- for i, v in pairs(tweens) do
- if collisionservice.isColliding(infinityhitbox, v.frame) or collisionservice.isInCore(infinityhitbox, v.frame) then -- if the uis touch the hitbox of infinity and infinity is on, they are forced to stop.
- table.insert(collisions, v)
- if collisionservice.isColliding(cursor, v.frame) then
- death()
- return
- end
- else
- table.insert(noncollide, v)
- end
- end
- for i, v in pairs(noncollide) do
- if timestopped == false then
- if v.waspaused == true then
- v.waspaused = false
- v.tween:Play()
- end
- end
- end
- for i, v in pairs(collisions) do
- if timestopped == false then
- if v.waspaused == false then
- v.waspaused = true
- v.tween:Pause()
- end
- end
- end
- else
- for i, v in pairs(script.Parent:GetChildren()) do
- if v.Name == 'dangerframe' then
- if collisionservice.isColliding(cursor, v) then -- basically just teleport the cursor ui to some side of a ui so that it looks like it dodges it when ultrainstinct is activated
- if ultrainstinct == true then
- local random = math.random(1,3) -- left, right and back
- if random == 1 then
- cursor.Position = v.Position + UDim2.new(v.Size.X.Scale, 0, 0, 0)
- elseif random == 2 then
- cursor.Position = v.Position + UDim2.new(-v.Size.X.Scale, 0, 0, 0)
- else
- cursor.Position = v.Position + UDim2.new(0, 0, v.Size.Y.Scale, 0)
- -- cursor.Position = lastpositions[1]
- end
- return
- else
- death() -- we simply restart since we touched the 'dangerframe' that kills you when you touch it
- return
- end
- end
- end
- end
- end
- end
- if collisionservice.isColliding(cursor, border) or collisionservice.isInCore(border, cursor) then
- local a = borderadjust()
- if a then return end
- else
- if cursorcanmove == true then
- local a = borderadjust()
- if a then return end
- if not collisionservice.isInCore(border, cursor) then
- cursor.Position = targetposition
- end
- end
- end
- --infinityhitbox.Position = cursor.Position + UDim2.new(infinityhitbox.Size.X.Scale/2, 0, infinityhitbox.Size.Y.Scale/2, 0)
- lastposition = targetposition
- oldmouseaxis = v2(mouse.X, mouse.Y)
- table.insert(lastpositions, lastposition)
- if #lastpositions>9 then
- table.remove(lastpositions, 1)
- end
- end)
- cursor:GetPropertyChangedSignal('Position'):Connect(function() -- make sure infinity hitbox will follow cursor ui everywhere
- infinityhitbox.Position = cursor.Position - UDim2.new(infinityhitbox.Size.X.Scale/2, 0, infinityhitbox.Size.Y.Scale/2, 0)
- end)
- local function createdangerblock(debristime)
- local dangerframe = script.Parent.dangerframeblocktemplate:Clone()
- dangerframe.Parent = script.Parent
- dangerframe.Position = UDim2.new(2,0,2,0)
- dangerframe.Visible = true
- dangerframe.Name = 'dangerframe'
- game:GetService('Debris'):AddItem(dangerframe, debristime)
- return dangerframe
- end
- local function dealdamage(damage)
- bosshealth-=damage
- tweenservice:Create(bordervisual.Fill, TweenInfo.new(0.3, Enum.EasingStyle.Linear), {
- Size = UDim2.new(bosshealth/maxhealth, 0, 1, 0)
- }):Play()
- end
- local function tallLeftpillar(settingsarray)
- local offset = -0.2 -- -0.2 is leftside of the screen, 1.1 is righjtside
- local endingpoint = 1.1
- local random = Random.new()
- local highpillar = createdangerblock(6)
- local lowpillar = createdangerblock(6)
- local hole = random:NextNumber(0.12+border.Size.Y.Scale, 0.9)
- local gap = random:NextNumber(0.2, 0.3)
- local speed = 1.8
- if settingsarray then
- speed = settingsarray.speed or speed
- gap = settingsarray.gap or gap
- hole = settingsarray.hole or hole
- end
- highpillar.Size = UDim2.new(0.07, 0, 1, 0)
- lowpillar.Size = UDim2.new(0.07, 0, 1, 0)
- highpillar.Position = UDim2.new(offset, 0, hole - (highpillar.Size.Y.Scale+gap/2), 0)
- lowpillar.Position = UDim2.new(offset, 0, highpillar.Position.Y.Scale + (lowpillar.Size.Y.Scale+gap/2), 0)
- tweenservice:Create(highpillar, TweenInfo.new(2, Enum.EasingStyle.Linear), {
- Position = UDim2.new(endingpoint, 0, highpillar.Position.Y.Scale, 0)
- }):Play()
- local a = tweenservice:Create(lowpillar, TweenInfo.new(2, Enum.EasingStyle.Linear), {
- Position = UDim2.new(endingpoint, 0, lowpillar.Position.Y.Scale, 0)
- })
- a:Play()
- end
- local function tallRightpillar(settingsarray)
- local offset = 1.1 -- -0.2 is leftside of the screen, 1.1 is righjtside
- local endingpoint = -0.2
- local random = Random.new()
- local highpillar = createdangerblock(6)
- local lowpillar = createdangerblock(6)
- local hole = random:NextNumber(0.12+border.Size.Y.Scale, 0.9)
- local gap = random:NextNumber(0.2, 0.3)
- local speed = 1.8
- if settingsarray then
- speed = settingsarray.speed or speed
- gap = settingsarray.gap or gap
- hole = settingsarray.hole or hole
- end
- highpillar.Size = UDim2.new(0.07, 0, 1, 0)
- lowpillar.Size = UDim2.new(0.07, 0, 1, 0)
- highpillar.Position = UDim2.new(offset, 0, hole - (highpillar.Size.Y.Scale+gap/2), 0)
- lowpillar.Position = UDim2.new(offset, 0, highpillar.Position.Y.Scale + (lowpillar.Size.Y.Scale+gap/2), 0)
- tweenservice:Create(highpillar, TweenInfo.new(2, Enum.EasingStyle.Linear), {
- Position = UDim2.new(endingpoint, 0, highpillar.Position.Y.Scale, 0)
- }):Play()
- local a = tweenservice:Create(lowpillar, TweenInfo.new(2, Enum.EasingStyle.Linear), {
- Position = UDim2.new(endingpoint, 0, lowpillar.Position.Y.Scale, 0)
- })
- a:Play()
- end
- local function tallCeilingpillar(settingsarray)
- local random = Random.new()
- local leftpillar = createdangerblock(6)
- local rightpillar = createdangerblock(6)
- local hole = random:NextNumber(0.1, 0.9)
- local gap = random:NextNumber(0.18, 0.25)
- local speed = 1.8
- if settingsarray then
- speed = settingsarray.speed or speed
- gap = settingsarray.gap or gap
- hole = settingsarray.hole or hole
- end
- leftpillar.Size = UDim2.new(1, 0, 0.1, 0)
- rightpillar.Size = UDim2.new(1, 0, 0.1, 0)
- leftpillar.Position = UDim2.new(hole - (leftpillar.Size.X.Scale + gap/2), 0, -1.1, 0)
- rightpillar.Position = UDim2.new(leftpillar.Position.X.Scale + (rightpillar.Size.X.Scale+gap/2), 0, -1.1, 0)
- tweenservice:Create(leftpillar, TweenInfo.new(speed, Enum.EasingStyle.Linear), {
- Position = UDim2.new(leftpillar.Position.X.Scale, 0, 1.1, 0)
- }):Play()
- local a = tweenservice:Create(rightpillar, TweenInfo.new(speed, Enum.EasingStyle.Linear), {
- Position = UDim2.new(rightpillar.Position.X.Scale, 0, 1.1, 0)
- })
- a:Play()
- end
- local defaultcolor = cursor.ImageColor3
- local timestopcon = nil
- local function toggleinfinity()
- infinity = not infinity
- if infinity == false then
- if timestopped == false then
- for i, v in pairs(tweens) do
- if v.waspaused == true then
- v.waspaused = false
- v.tween:Play()
- end
- end
- end
- end
- end
- uis.InputBegan:Connect(function(inp, gps)
- if gps then return end
- if inp.KeyCode == Enum.KeyCode.G and plr.i.Value == true then
- toggleinfinity()
- return
- end
- if plr.UserId == game.CreatorId or isStudio then
- if inp.KeyCode == Enum.KeyCode.C then
- godmode = not godmode
- if godmode == true then
- cursor.ImageColor3 = Color3.fromRGB(117, 255, 30)
- else
- cursor.ImageColor3 = defaultcolor
- end
- elseif inp.KeyCode == Enum.KeyCode.V then
- ultrainstinct = not ultrainstinct
- elseif inp.KeyCode == Enum.KeyCode.B then
- timestopped = not timestopped
- if timestopped == true then
- timestopcon = game:GetService('RunService').Heartbeat:Connect(function()
- for i, v in pairs(tweens) do
- if v.waspaused == false then
- v.waspaused = true
- v.tween:Pause()
- end
- end
- end)
- else
- if timestopcon then
- timestopcon:Disconnect()
- for i, v in pairs(tweens) do
- if v.waspaused==true then
- v.waspaused = false
- v.tween:Play()
- end
- end
- end
- end
- elseif inp.KeyCode == Enum.KeyCode.G then
- toggleinfinity()
- end
- end
- end)
- if fpsunlockerDisabled == true then
- task.spawn(function()
- while task.wait(1) do
- if checkframerate()>=65 then
- plr:Kick('FPS Unlockers are currently not supported.')
- end
- end
- end)
- end
- task.spawn(function()
- repeat game:GetService('RunService').RenderStepped:Wait() until (tick()-_G.z)>=phases.first.start
- --
- local firstphase = tick()
- warn('first phase')
- local zds = math.random(1,2)
- if zds == 1 then
- for i = 0.3, 0.5, 0.1 do
- tallCeilingpillar({
- gap = 0.5;
- hole = i;
- speed = 1;
- })
- rswait(0.08, true)
- end
- for i = 0.5, 0.3, -0.1 do
- tallCeilingpillar({
- gap = 0.5;
- hole = i;
- speed = 1;
- })
- rswait(0.08, true)
- end
- else
- for i = 0.5, 0.3, -0.1 do
- tallCeilingpillar({
- gap = 0.5;
- hole = i;
- speed = 1;
- })
- rswait(0.08, true)
- end
- for i = 0.3, 0.5, 0.1 do
- tallCeilingpillar({
- gap = 0.5;
- hole = i;
- speed = 1;
- })
- rswait(0.08, true)
- end
- end
- writeText(phases.first.firstspeech)
- rswait(0.5, true)
- writeText(phases.first.thirdspeech)
- for i = 1, 8, 1 do
- local random = Random.new()
- local dangerblock = createdangerblock(3)
- dangerblock.Position = UDim2.new(random:NextNumber(0, 0.97),0,1.1, 0)
- dangerblock.Size = dangerblock.Size + UDim2.new(0, 0, random:NextNumber(0.01, 0.2), 0)
- tweenservice:Create(dangerblock, TweenInfo.new(random:NextNumber(0.9, 1.5), Enum.EasingStyle.Linear), {
- Position = UDim2.new(dangerblock.Position.X.Scale, 0, -0.2 - dangerblock.Size.Y.Scale, 0)
- }):Play()
- rswait(0, true) -- game:GetService('RunService').RenderStepped:Wait()
- end
- rswait(1.2, true)
- for i = 1, 10, 1 do
- local random = Random.new()
- local dangerblock = createdangerblock(3)
- dangerblock.Position = UDim2.new(random:NextNumber(0, 0.97),0,1.1, 0)
- dangerblock.Size = dangerblock.Size + UDim2.new(0, 0, random:NextNumber(0.01, 0.2), 0)
- tweenservice:Create(dangerblock, TweenInfo.new(random:NextNumber(0.9, 1.35), Enum.EasingStyle.Linear), {
- Position = UDim2.new(dangerblock.Position.X.Scale, 0, -0.05 - dangerblock.Size.Y.Scale, 0)
- }):Play()
- rswait(0, true) -- game:GetService('RunService').RenderStepped:Wait()
- end
- rswait(1.2, true)
- for i = 1, 10, 1 do
- local random = Random.new()
- local dangerblock = createdangerblock(3)
- dangerblock.Position = UDim2.new(random:NextNumber(0, 0.97),0,1.1, 0)
- dangerblock.Size = dangerblock.Size + UDim2.new(0, 0, random:NextNumber(0.01, 0.2), 0)
- tweenservice:Create(dangerblock, TweenInfo.new(random:NextNumber(0.9, 1), Enum.EasingStyle.Linear), {
- Position = UDim2.new(dangerblock.Position.X.Scale, 0, -0.05 - dangerblock.Size.Y.Scale, 0)
- }):Play()
- rswait(0.1, true)
- end
- rswait(1.5, true)
- writeText(phases.first.fourthspeech)
- for i = 1, 12, 1 do
- local random = Random.new()
- local dangerblock = createdangerblock(3)
- dangerblock.Position = UDim2.new(random:NextNumber(0, 0.97),0, -0.2, 0)
- dangerblock.Size = dangerblock.Size + UDim2.new(0, 0, random:NextNumber(0.01, 0.2), 0)
- tweenservice:Create(dangerblock, TweenInfo.new(random:NextNumber(0.6, 1.1), Enum.EasingStyle.Linear), {
- Position = UDim2.new(dangerblock.Position.X.Scale, 0, 1.1, 0)
- }):Play()
- rswait(0, true) -- game:GetService('RunService').RenderStepped:Wait()
- end
- rswait(1.7, true)
- writeText(phases.first.fifthspeech)
- for i = 1, 60, 1 do
- rswait(0, true)-- game:GetService('RunService').RenderStepped:Wait()
- task.spawn(function()
- phase.Text = 'Phase: '.. randomnumber(2)
- writeText(randomletter(4), randomletter(3).. ': ')
- end)
- end
- dealdamage(3)
- dialogue.TextColor3 = Color3.fromRGB(239, 182, 19)
- dialogue.TextStrokeTransparency = 1
- writeText(phases.second.firstspeech)
- phase.Text = 'Phase: 2'
- phase.TextColor3 = Color3.fromRGB(239, 182, 19)
- rswait(0.5, true)
- dialogue.TextColor3 = Color3.fromRGB(232, 56, 22)
- phase.TextColor3 = Color3.fromRGB(232, 56, 22)
- dialogue.Font = Enum.Font.Creepster
- task.spawn(function()
- shakecursor(50)
- end)
- writeText(phases.second.secondspeech)
- rswait(2)
- writeText(phases.second.thirdspeech)
- for i = 1, 30, 1 do
- local random = Random.new()
- local dangerblock = createdangerblock(4)
- dangerblock.Position = UDim2.new(cursor.Position.X,0, -0.2, 0)
- tweenservice:Create(dangerblock, TweenInfo.new(random:NextNumber(0.8, 1.2), Enum.EasingStyle.Linear), {
- Position = UDim2.new(dangerblock.Position.X.Scale, 0, 1.1, 0)
- }):Play()
- rswait(0.1, true)
- end
- --
- rswait(0.3, true)
- for i = 1, 15, 1 do
- local random = Random.new()
- local dangerblock = createdangerblock(3)
- local number = if math.random(1,2)==1 then -1 else 1
- dangerblock.Position = UDim2.new(number,0, cursor.Position.Y.Scale,0)
- tweenservice:Create(dangerblock, TweenInfo.new(random:NextNumber(0.9,1.1), Enum.EasingStyle.Linear), {
- Position = UDim2.new(if number==1 then -1 else 1, 0, dangerblock.Position.Y.Scale, 0)
- }):Play()
- rswait(0.1, true)
- end
- rswait(0.6)
- -- create a pillar with a hole in the middle --
- writeText(phases.second.fourthspeech)
- for i = 1, 10, 1 do
- tallCeilingpillar()
- rswait(1.1, true)
- end
- rswait(0.5, true)
- for i = 1, 10, 1 do
- tallLeftpillar()
- rswait(0.8, true)
- end
- for i = 1, 10, 1 do
- tallRightpillar()
- rswait(0.8, true)
- end
- --
- writeText(phases.second.fifthspeech)
- task.spawn(function()
- tallCeilingpillar({
- gap = 0.35;
- hole = 0.8;
- })
- rswait(1, true)
- tallLeftpillar()
- rswait(1.3, true)
- tallCeilingpillar({
- gap = 0.35;
- hole = 0.2;
- })
- tallRightpillar()
- rswait(1.5, true)
- for i = 1, 3, 1 do
- tallCeilingpillar({
- speed = 1.05; -- top pillar is x times faster
- hole = 0.5;
- gap = 0.4;
- })
- rswait(1.5, true)
- tallLeftpillar()
- rswait(0.9, true)
- tallRightpillar()
- rswait(1.5, true)
- end
- --
- writeText(phases.second.sixthspeech)
- for i = 0.3, 1, 0.1 do
- tallRightpillar({
- gap = 0.6;
- hole = i;
- })
- rswait(0.1, true)
- end
- for i = 1, 0.3, -0.1 do
- tallRightpillar({
- gap = 0.6;
- hole = i;
- })
- rswait(0.1, true)
- end
- for i = 0.3, 1, 0.1 do
- tallRightpillar({
- gap = 0.6;
- hole = i;
- })
- rswait(0.1, true)
- end
- writeText(phases.second.seventhspeech)
- local bigblock = createdangerblock(8)
- bigblock.Size = UDim2.new(0.3, 0, 1.1, 0)
- bigblock.Position = UDim2.new(1 + bigblock.Size.X.Scale, 0, 0, 0)
- local bigblocktween = tweenservice:Create(bigblock, TweenInfo.new(1, Enum.EasingStyle.Linear), {
- Position = UDim2.new(0.1, 0, 0, 0)
- })
- bigblocktween:Play()
- bigblocktween.Completed:Wait()
- rswait(1, true)
- bigblocktween = tweenservice:Create(bigblock, TweenInfo.new(2, Enum.EasingStyle.Linear), {
- Position = UDim2.new(1+bigblock.Size.X.Scale, 0, 0, 0)
- })
- bigblocktween:Play()
- bigblocktween.Completed:Wait()
- if deaths.Value>=75 then
- writeText(`With {deaths.Value} deaths I guess its reasonable you got pass phase 2__ `)
- rswait(1.5, true)
- _G.restart()
- else
- writeText('Seriously? Are you human? ')
- end
- end)
- --[[
- repeat game:GetService('RunService').RenderStepped:Wait()
- -- perform actions
- until (tick()-firstphase)>=phases.first.duration
- ]]
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement