Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- imagine naming a script mainAPI when its not even an api but actually using one
- -- :thonk:
- local RunService = game:GetService("RunService")
- local contentBro = game:GetService("ContentProvider")
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- local inGame = false
- local debounce = false
- local ts = game:GetService("TweenService")
- local dead = false
- local objectDict = {
- [script.Parent.background.ThreeCactusSmall] = 0.45,
- [script.Parent.background.TwoCactus] = 0.45,
- [script.Parent.background.OneCactus] = 0.1
- }
- local objects = {}
- for obj in pairs(objectDict) do
- table.insert(objects, obj)
- end
- contentBro:PreloadAsync(objects)
- local dinosaur = script.Parent.background.dinosaur
- local uis = game:GetService("UserInputService")
- mouse.Icon = "rbxassetid://3313572053"
- local objectTable = {}
- ------------------ ok now stuff that doesnt matter in the fucking slightest ------------------------
- script.Parent.onlyinteractable.MouseEnter:Connect(function()
- mouse.Icon = "rbxassetid://3313510115"
- end)
- script.Parent.onlyinteractable.MouseLeave:Connect(function()
- mouse.Icon = "rbxassetid://3313572053"
- end)
- local pls = {true}
- local t = 3
- uis.InputBegan:Connect(function(inp,gpe)
- if (inp.KeyCode == Enum.KeyCode.Space or inp.UserInputType == Enum.UserInputType.Touch) and not gpe and not inGame then
- inGame = true
- debounce = true
- dinosaur.Position = UDim2.new(0.001, 0, 0.55, 0)
- script.Parent.urdeadlol.Visible = false
- dinosaur.Image = "rbxassetid://3314227620"
- script.Parent.barrier1.Position = UDim2.new(0.689, 0, 0.542, 0)
- for i, obj in pairs(objectTable) do
- table.remove(objectTable, i)
- obj:Destroy()
- end
- script.Parent.background.score.Text = "00000"
- local function aa()
- script.Parent.badboy.Position = UDim2.new(0.667, 0, 0.542, 0)
- script.Parent.badboy:TweenPosition(script.Parent.badboy.Position - UDim2.new(0, script.Parent.badboy.AbsoluteSize.X, 0, 0), Enum.EasingDirection.Out,Enum.EasingStyle.Linear,t,false,aa)
- end
- aa()
- dinosaur:TweenPosition(UDim2.new(0.001, 0,0.1, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.3)
- wait(.31)
- dinosaur:TweenPosition(UDim2.new(0.001, 0,0.55, 0),Enum.EasingDirection.In,Enum.EasingStyle.Quad,.2)
- wait(.2)
- script.Parent.barrier1:TweenPosition(UDim2.new(0.92, 0,0.542, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1)
- wait(.5)
- dinosaur:TweenPosition(UDim2.new(0.021, 0,0.55, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Linear,.2)
- debounce = false
- spawn(function()
- while inGame and not dead do
- dinosaur.Image = "rbxassetid://3314873926"
- wait(.1)
- if dead then break end
- dinosaur.Image = "rbxassetid://3314873718"
- wait(.1)
- end
- end)
- spawn(function()
- while not dead do
- script.Parent.background.score.Text = string.format("%05.f", tonumber(script.Parent.background.score.Text) + 1)
- wait(0.1)
- end
- end)
- dead = false
- local collidedWith
- local hm = false
- local a = 0
- while not dead and pls[1] do
- if a % 10 == 0 then t = math.clamp(t, 1, 3) end
- a = (a + 1) % 10
- local object
- local nani = math.random() -- nani?!
- --if nani == 1 or nani == 2 and not dead then print("goofy goober")
- if not dead then print("goofy goober")
- --[[local original = script.Parent.background.TwoCactus
- object = original:Clone()
- object.Position = original.Position
- object.Parent = script.Parent.Parent.background
- elseif nani == 2 then]]
- --local original = script.Parent.background.ThreeCactusSmall
- local s = 0
- local original
- for object, chance in pairs(objectDict) do
- if nani >= s and nani < s + chance then
- original = object
- break
- end
- s = s + chance
- end
- --object = script.Parent.background.ThreeCactusSmall:Clone()
- object = original:Clone()
- object.Position = original.Position
- object.Parent = script.Parent.background
- object:TweenPosition(UDim2.new(-0.2, 0,object.Position.Y.Scale,0),Enum.EasingDirection.In,Enum.EasingStyle.Linear,(object.Parent.AbsoluteSize.X * (0.2 + object.Position.X.Scale))/(script.Parent.badboy.AbsoluteSize.X/t), true)
- table.insert(objectTable, object)
- local collisionConnection
- collisionConnection = RunService.Heartbeat:Connect(function()
- if dinosaur.AbsolutePosition.X <= object.AbsolutePosition.X + object.AbsoluteSize.X and
- dinosaur.AbsolutePosition.X + dinosaur.AbsoluteSize.X >= object.AbsolutePosition.X and
- dinosaur.AbsolutePosition.Y <= object.AbsolutePosition.Y + object.AbsoluteSize.Y and
- dinosaur.AbsolutePosition.Y + dinosaur.AbsoluteSize.Y >= object.AbsolutePosition.Y then
- collisionConnection:Disconnect()
- print("epic gamer collision")
- collidedWith = object
- for i, obj in pairs(objectTable) do
- if obj ~= collidedWith then
- table.remove(objectTable, i)
- obj:Destroy()
- end
- end
- object:TweenPosition(object.Position,Enum.EasingDirection.In,Enum.EasingStyle.Linear,2.5, true)
- dinosaur:TweenPosition(dinosaur.Position,Enum.EasingDirection.In,Enum.EasingStyle.Quad,.2,true)
- script.Parent.badboy:TweenPosition(script.Parent.badboy.Position,nil,nil,0,true)
- script.Parent.urdeadlol.Visible = true
- dinosaur.Image = "rbxassetid://3315457212"
- pls[1] = false
- pls[2] = true
- hm = true
- dead = true
- inGame = false
- end
- end)
- local sum = 0
- while sum <= 1.5 do
- if hm then
- hm = false
- for i, obj in pairs(objectTable) do
- if obj ~= collidedWith then
- table.remove(objectTable, i)
- obj:Destroy()
- end
- end
- end
- sum = sum + RunService.Heartbeat:Wait()
- end
- coroutine.resume(coroutine.create(function()
- wait((object.Parent.AbsoluteSize.X * (0.2 + object.Position.X.Scale))/(script.Parent.badboy.AbsoluteSize.X/t))
- if not dead then
- collisionConnection:Disconnect()
- object:Destroy()
- end
- end))
- end
- end
- table.remove(pls, 1)
- end
- end)
- local debounce2
- uis.InputBegan:Connect(function(inp,gpe)
- if (inp.KeyCode == Enum.KeyCode.Space or inp.UserInputType == Enum.UserInputType.Touch) and not gpe and inGame and not debounce2 and not dead then
- debounce2 = true
- script.Parent.Parent.jump:Play()
- dinosaur:TweenPosition(UDim2.new(dinosaur.Position.X.Scale, 0,0.1, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.3,true)
- wait(.31)
- if not dead then
- dinosaur:TweenPosition(UDim2.new(dinosaur.Position.X.Scale, 0,0.55, 0),Enum.EasingDirection.In,Enum.EasingStyle.Quad,.2,true)
- wait(.21)
- end
- debounce2 = false
- end
- end)
- --[[while true do
- wait()
- while inGame == true do
- wait()
- script.Parent.background:TweenPosition(UDim2.new(-1.234, 0,0.542, 0),Enum.EasingDirection.In,Enum.EasingStyle.Linear,3)
- wait(3)
- script.Parent.background.Position = UDim2.new(0.667, 0,0.542, 0)
- end
- end
- ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement