Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- part1 = Instance.new("Part", owner.Character)
- part1.Size = Vector3.new(5,5,0.1)
- part1.Anchored = true
- part1.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,2)
- local screengui2 = Instance.new("SurfaceGui", part1)
- screengui2.Name = "Hud"
- screengui2.Face = Enum.NormalId.Back
- local fake3 = Instance.new("Frame", screengui2)
- fake3.BackgroundTransparency = 1
- fake3.Size = UDim2.new(0.75,0,0.75,0)
- fake3.AnchorPoint = Vector2.new(0.5, 0.5)
- fake3.Position = UDim2.new(0.5, 0, 0.5, 0)
- fake3.ClipsDescendants = true
- local fake = Instance.new("Frame", fake3)
- fake.BackgroundTransparency = 0
- fake.Size = UDim2.new(0.45,0,0.125,0)
- fake.AnchorPoint = Vector2.new(0.5, 0.85)
- fake.Position = UDim2.new(0.5, 0, 0.85, 0)
- local fake4 = Instance.new("Frame", fake3)
- fake4.BackgroundTransparency = 0
- fake4.Size = UDim2.new(1,0,0.125,0)
- fake4.AnchorPoint = Vector2.new(0.5, 1)
- fake4.Position = UDim2.new(0.5, 0, 1, 0)
- fake4.BackgroundColor3 = Color3.fromRGB(255, 17, 0)
- local grad = Instance.new("UIGradient",fake4)
- grad.Color = ColorSequence.new(Color3.fromRGB(255, 17, 0), Color3.fromRGB(255, 128, 0))
- local fake2 = Instance.new("Frame", fake3)
- fake2.BackgroundTransparency = 0
- fake2.Size = UDim2.new(0.45,0,0.125,0)
- fake2.AnchorPoint = Vector2.new(1.5, 0.85)
- fake2.Position = UDim2.new(1.5, 0, 0.85, 0)
- local fake5 = Instance.new("Frame", fake3)
- fake5.BackgroundTransparency = 0
- fake5.Size = UDim2.new(0.15,0,0.5,0)
- fake5.AnchorPoint = Vector2.new(1.75, 0.4)
- fake5.Position = UDim2.new(1.75, 0, 0.4, 0)
- local fake6 = Instance.new("Frame", fake3)
- fake6.BackgroundTransparency = 0
- fake6.Size = UDim2.new(0.15,0,0.15,0)
- fake6.AnchorPoint = Vector2.new(1.7, 0.3)
- fake6.Position = UDim2.new(1.7, 0, 0.3, 0)
- fake6.BackgroundColor3 = Color3.fromRGB(52, 235, 61)
- prox = Instance.new("ProximityPrompt",owner.Character.Head)
- prox.Style = Enum.ProximityPromptStyle.Custom
- prox.Enabled = true
- prox.KeyboardKeyCode = Enum.KeyCode.D
- prox3 = Instance.new("ProximityPrompt",owner.Character.Head)
- prox3.Style = Enum.ProximityPromptStyle.Custom
- prox3.Enabled = true
- prox3.KeyboardKeyCode = Enum.KeyCode.Space
- local right = false
- local jump = false
- prox.Triggered:Connect(function(player)
- if player == owner then
- right = true
- end
- end)
- prox.TriggerEnded:Connect(function(player)
- if player == owner then
- right = false
- end
- end)
- prox2 = Instance.new("ProximityPrompt",owner.Character.Head)
- prox2.Style = Enum.ProximityPromptStyle.Custom
- prox2.Enabled = true
- prox2.KeyboardKeyCode = Enum.KeyCode.A
- local left = false
- prox2.Triggered:Connect(function(player)
- if player == owner then
- left = true
- end
- end)
- prox3.Triggered:Connect(function(player)
- if player == owner then
- jump = true
- wait(0.125)
- jump = false
- end
- end)
- prox2.TriggerEnded:Connect(function(player)
- if player == owner then
- left = false
- end
- end)
- local A = Instance.new("Sound", part1)
- A.SoundId = "rbxassetid://5652761093"
- A.Volume = 2
- local frame = Instance.new("ImageLabel", screengui2)
- frame.BackgroundTransparency = 1
- frame.Image = "http://www.roblox.com/asset/?id=9015080727"
- frame.Size = UDim2.new(0.125,0,0.125,0)
- frame.AnchorPoint = Vector2.new(0.5, 0.5)
- frame.Position = UDim2.new(0.5, 0, 0.5, 0)
- frame.Image = "rbxassetid://9014464566"
- frame.ImageRectSize = Vector2.new(540, 540)
- local tl = Instance.new("TextBox", screengui2)
- tl.Size = UDim2.new(0.5, 0, 0.125, 0)
- tl.BackgroundTransparency = 1
- tl.AnchorPoint = Vector2.new(0.5, 0.35)
- tl.Position = UDim2.new(0.5, 0, 0.35, 0)
- tl.Text = ""
- tl.TextSize = 25
- local frame2 = Instance.new("Frame", frame)
- frame2.BackgroundTransparency = 1
- frame2.Size = UDim2.new(0.75,0,1,0)
- frame2.AnchorPoint = Vector2.new(0.5, 0.5)
- frame2.Position = UDim2.new(0.5, 0, 0.5, 0)
- local frames = {
- Vector2.new(0, 0); Vector2.new(1, 0);
- }
- coroutine.wrap(function()
- while true do
- for i = 1, #frames do
- frame.ImageRectOffset = frames[i] * frame.ImageRectSize
- wait(.2)
- end
- end
- end)()
- local db = false
- function imdead()
- if db then return end
- db = true
- A:Play()
- tl.Text = "you are the kil"
- end
- function thewin()
- if db then return end
- db = true
- tl.Text = "you are done the win!111!"
- end
- function collidesWith(gui1, gui2,gui3,gui4,gui5,gui6)
- local gui1_topLeft = gui1.AbsolutePosition
- local gui1_bottomRight = gui1_topLeft + gui1.AbsoluteSize
- local gui3_topLeft = gui3.AbsolutePosition
- local gui3_bottomRight = gui3_topLeft + gui3.AbsoluteSize
- local gui4_topLeft = gui4.AbsolutePosition
- local gui4_bottomRight = gui4_topLeft + gui4.AbsoluteSize
- local gui5_topLeft = gui5.AbsolutePosition
- local gui5_bottomRight = gui5_topLeft + gui5.AbsoluteSize
- local gui6_topLeft = gui6.AbsolutePosition
- local gui6_bottomRight = gui6_topLeft + gui6.AbsoluteSize
- local gui2_topLeft = gui2.AbsolutePosition
- local gui2_bottomRight = gui2_topLeft + gui2.AbsoluteSize
- return ((gui1_topLeft.x < gui2_bottomRight.x and gui1_bottomRight.x > gui2_topLeft.x) and (gui1_topLeft.y < gui2_bottomRight.y and gui1_bottomRight.y > gui2_topLeft.y)), ((gui3_topLeft.x < gui2_bottomRight.x and gui3_bottomRight.x > gui2_topLeft.x) and (gui3_topLeft.y < gui2_bottomRight.y and gui3_bottomRight.y > gui2_topLeft.y)), ((gui4_topLeft.x < gui2_bottomRight.x and gui4_bottomRight.x > gui2_topLeft.x) and (gui4_topLeft.y < gui2_bottomRight.y and gui4_bottomRight.y > gui2_topLeft.y)), ((gui5_topLeft.x < gui2_bottomRight.x and gui5_bottomRight.x > gui2_topLeft.x) and (gui5_topLeft.y < gui2_bottomRight.y and gui5_bottomRight.y > gui2_topLeft.y)),((gui6_topLeft.x < gui2_bottomRight.x and gui6_bottomRight.x > gui2_topLeft.x) and (gui6_topLeft.y < gui2_bottomRight.y and gui6_bottomRight.y > gui2_topLeft.y))
- end
- dead = false
- canjump = true
- while true do
- task.wait()
- local grav,grav2,death,wall,won = collidesWith(fake,frame2,fake2,fake4,fake5,fake6)
- if death then
- imdead()
- dead = true
- end
- if won then
- thewin()
- dead = true
- end
- if grav == false and grav2 == false and not dead then
- fake.Position = fake.Position + UDim2.new(0, 0, -0.00325, 0)
- fake2.Position = fake2.Position + UDim2.new(0, 0, -0.00325, 0)
- fake4.Position = fake4.Position + UDim2.new(0, 0, -0.00325, 0)
- fake5.Position = fake5.Position + UDim2.new(0, 0, -0.00325, 0)
- fake6.Position = fake6.Position + UDim2.new(0, 0, -0.00325, 0)
- elseif not dead then
- canjump = true
- end
- if wall then
- fake.Position = fake.Position + UDim2.new(0.0125, 0, 0, 0)
- fake2.Position = fake2.Position + UDim2.new(0.0125, 0, 0, 0)
- fake5.Position = fake5.Position + UDim2.new(0.0125, 0, 0, 0)
- fake6.Position = fake6.Position + UDim2.new(0.0125, 0, 0, 0)
- end
- if jump and not dead and canjump then
- canjump = false
- fake.Position = fake.Position + UDim2.new(0, 0, 0.25, 0)
- fake2.Position = fake2.Position + UDim2.new(0, 0, 0.25, 0)
- fake4.Position = fake4.Position + UDim2.new(0, 0, 0.25, 0)
- fake5.Position = fake5.Position + UDim2.new(0, 0, 0.25, 0)
- fake6.Position = fake6.Position + UDim2.new(0, 0, 0.25, 0)
- end
- if left and not dead then
- fake.Position = fake.Position + UDim2.new(0.0125, 0, 0, 0)
- fake2.Position = fake2.Position + UDim2.new(0.0125, 0, 0, 0)
- fake5.Position = fake5.Position + UDim2.new(0.0125, 0, 0, 0)
- fake6.Position = fake6.Position + UDim2.new(0.0125, 0, 0, 0)
- frame.Image = "http://www.roblox.com/asset/?id=9015078080"
- elseif right and not dead then
- fake.Position = fake.Position + UDim2.new(-0.0125, 0, 0, 0)
- fake2.Position = fake2.Position + UDim2.new(-0.0125, 0, 0, 0)
- fake5.Position = fake5.Position + UDim2.new(-0.0125, 0, 0, 0)
- fake6.Position = fake6.Position + UDim2.new(-0.0125, 0, 0, 0)
- frame.Image = "http://www.roblox.com/asset/?id=9015080727"
- end
- end
Add Comment
Please, Sign In to add comment