Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(1)
- local remote = owner:FindFirstChild("littlebolgozoomzoom186723")
- script.Name = "erjghjrgfjghfjgjf"..tostring(math.random(11111111,99999999))
- if remote == nil then
- remote = Instance.new("RemoteEvent",owner)
- remote.Name = "littlebolgozoomzoom186723"
- end
- local serversounds = Instance.new("Part")
- serversounds.Name = "ServerSounds"
- serversounds.CanCollide = false
- serversounds.Massless = true
- serversounds.CanQuery = false
- serversounds.Transparency = 1
- serversounds.Size = Vector3.new(0.1,0.1,0.1)
- local ball = nil
- local roll1 = Instance.new("Sound",serversounds)
- roll1.SoundId = "rbxassetid://6560398360"
- roll1.Volume = 0
- roll1.PlaybackSpeed = 2
- roll1:Play()
- roll1.Looped = true
- roll1.Name = "BALLROLLYPOLLY"
- local onground = false
- remote.OnServerEvent:Connect(function(player,typ,data)
- if player == owner then
- if typ == "ready" then
- ball = Instance.new("Part",script)
- ball.Shape = Enum.PartType.Ball
- ball.Size = Vector3.new(1,1,1)
- ball.Material = Enum.Material.Foil
- ball.CFrame = CFrame.new(0,50,0)
- ball.Color = Color3.fromRGB(255,125,255)
- ball.Name = "sdjlkndsfjkgjsdf"..tostring(math.random(11111111,99999999))
- serversounds.CFrame = ball.CFrame
- serversounds.Parent = ball
- local weld = Instance.new("WeldConstraint",ball)
- weld.Part0 = ball
- weld.Part1 = serversounds
- local sound = Instance.new("Sound",ball)
- sound.SoundId = "rbxassetid://2852749304"
- if owner.UserId == 47202740 then
- ball.Color = Color3.fromRGB(14,105,171)
- elseif owner.UserId == 46767274 then
- ball.Color = Color3.fromRGB(255,155,255)
- elseif owner.UserId == 34629254 then
- ball.Color = Color3.fromRGB(255,55,255)
- else
- local countup = math.random(255,255*5)
- local r = math.random(0,255)
- countup = countup + 1
- math.randomseed(countup)
- local g = math.random(0,255)
- countup = countup + 1
- math.randomseed(countup)
- local b = math.random(0,255)
- ball.Color = Color3.fromRGB(r,g,b)
- end
- --local tex = Instance.new("Texture",ball)
- --tex.Texture = "http://www.roblox.com/asset/?id=9844230455"
- --tex.StudsPerTileU = 0.8
- --tex.StudsPerTileV = 0.8
- --tex.Transparency = 0
- --tex.Face = Enum.NormalId.Top
- --local tex2 = tex:Clone()
- --tex2.Face = Enum.NormalId.Front
- --tex2.Parent = tex.Parent
- --local tex2 = tex:Clone()
- --tex2.Face = Enum.NormalId.Back
- --tex2.Parent = tex.Parent
- --local tex2 = tex:Clone()
- --tex2.Face = Enum.NormalId.Bottom
- --tex2.Parent = tex.Parent
- --local tex2 = tex:Clone()
- --tex2.Face = Enum.NormalId.Left
- --tex2.Parent = tex.Parent
- --local tex2 = tex:Clone()
- --tex2.Face = Enum.NormalId.Right
- --tex2.Parent = tex.Parent
- remote:FireClient(owner,"Ball",ball:GetFullName())
- coroutine.resume(coroutine.create(function()
- while wait() do
- ball:SetNetworkOwner(owner)
- end
- end))
- elseif typ == "JumpSound" then
- local a,b = pcall(function()
- local pit1 = data[1]
- local pit2 = data[2]
- local jumpsound1 = serversounds:FindFirstChild("JumpSound1")
- local jumpsound2 = serversounds:FindFirstChild("JumpSound2")
- if jumpsound1 == nil then
- jumpsound1 = Instance.new("Sound",serversounds)
- jumpsound1.Name = "JumpSound1"
- end
- if jumpsound2 == nil then
- jumpsound2 = Instance.new("Sound",serversounds)
- jumpsound2.Name = "JumpSound2"
- end
- jumpsound1.SoundId = "rbxassetid://180204586"
- jumpsound1.Volume = 1
- jumpsound1.PlaybackSpeed = pit1
- jumpsound2.SoundId = "rbxassetid://4560102662"
- jumpsound2.Volume = 1
- jumpsound2.PlaybackSpeed = pit2
- jumpsound1:Play()
- jumpsound2:Play()
- end)
- elseif typ == "SoftHit" then
- local sound = serversounds:FindFirstChild("SoftHitSound")
- if sound == nil then
- sound = Instance.new("Sound",serversounds)
- sound.Name = "SoftHitSound"
- end
- sound.SoundId = "rbxassetid://9120885468"
- sound.Volume = data[1]
- sound.PlaybackSpeed = data[2]
- sound:Play()
- elseif typ == "HardHit" then
- local sound = serversounds:FindFirstChild("HardHitSound1")
- if sound == nil then
- sound = Instance.new("Sound",serversounds)
- sound.Name = "HardHitSound1"
- end
- sound.SoundId = "rbxassetid://9119073573"
- sound.Volume = data[1][1]
- sound.PlaybackSpeed = data[1][2]
- sound:Play()
- local sound = serversounds:FindFirstChild("HardHitSound2")
- if sound == nil then
- sound = Instance.new("Sound",serversounds)
- sound.Name = "HardHitSound2"
- end
- sound.SoundId = "rbxassetid://9119911864"
- sound.Volume = data[2][1]
- sound.PlaybackSpeed = data[2][2]
- sound:Play()
- local sound = serversounds:FindFirstChild("HardHitSound3")
- if sound == nil then
- sound = Instance.new("Sound",serversounds)
- sound.Name = "HardHitSound3"
- end
- sound.SoundId = "rbxassetid://9120109021"
- sound.Volume = data[3][1]
- sound.PlaybackSpeed = data[3][2]
- sound:Play()
- local sound = serversounds:FindFirstChild("HardHitSound4")
- if sound == nil then
- sound = Instance.new("Sound",serversounds)
- sound.Name = "HardHitSound4"
- end
- sound.SoundId = "rbxassetid://9120885468"
- sound.Volume = data[4][1]
- sound.PlaybackSpeed = data[4][2]
- sound:Play()
- elseif typ == "InAir" then
- onground = false
- elseif typ == "OnGround" then
- onground = true
- end
- end
- end)
- game:GetService("RunService").Heartbeat:Connect(function(num)
- if roll1 == nil or roll1.Parent ~= serversounds then
- local roll1 = serversounds:FindFirstChild("BALLROLLYPOLLY")
- if roll1 == nil then
- roll1 = Instance.new("Sound",serversounds)
- roll1.SoundId = "rbxassetid://6560398360"
- roll1.Volume = 0
- roll1.PlaybackSpeed = 2
- roll1:Play()
- roll1.Looped = true
- roll1.Name = "BALLROLLYPOLLY"
- end
- end
- if onground and ball ~= nil then
- local velocity = ball.AssemblyLinearVelocity
- local tv = Vector2.new(velocity.X,velocity.Z).Magnitude
- local volume = math.clamp(tv/15,0,1)
- local playbackspeed = math.clamp((1.01^tv),1,5)
- roll1.Volume = volume
- roll1.PlaybackSpeed = playbackspeed*2
- elseif not onground and ball ~= nil then
- roll1.Volume = 0
- end
- end)
- local gui = Instance.new("ScreenGui",owner.PlayerGui)
- gui.ResetOnSpawn = false
- NLS([[wait(2)
- local cam = workspace.CurrentCamera
- local owner = game.Players.LocalPlayer
- local remote = owner:WaitForChild("littlebolgozoomzoom186723")
- remote:FireServer("ready")
- local ball = nil
- local lastjump = tick()
- local cotime = tick()
- local cancotime = tick()
- local h = false
- local eventery = nil
- eventery = remote.OnClientEvent:Connect(function(typ,b)
- print(typ,b)
- if typ == "Ball" then
- ball = b
- end
- end)
- repeat wait() until ball ~= nil
- eventery:Disconnect()
- workspace.Gravity = 196.2/4
- -- script begins
- local function getObjectFromFullName(str)
- local thing = game
- local spl = string.split(str,".")
- for i,v in pairs(spl) do
- local newthing = thing:FindFirstChild(v)
- if newthing ~= nil then
- thing = newthing
- else
- return nil
- end
- end
- return thing
- end
- ball = getObjectFromFullName(ball)
- ball.CustomPhysicalProperties = PhysicalProperties.new(ball.Material)
- cam.CameraSubject = ball
- ball.CFrame = CFrame.new(0,50,0)
- ball.ServerSounds:Destroy()
- local w,s,a,d,space = false,false,false,false,false
- local jumping = false
- local uis = game:GetService("UserInputService")
- local random = math.random(900,1100)/1000
- local jumpsound1 = Instance.new("Sound",ball)
- jumpsound1.SoundId = "rbxassetid://180204586"
- jumpsound1.Volume = 1
- jumpsound1.PlaybackSpeed = random*4
- jumpsound1.Name = "JUMPSOUND1CLIENT"
- local jumpsound2 = Instance.new("Sound",ball)
- jumpsound2.SoundId = "rbxassetid://4560102662"
- jumpsound2.Volume = 1
- jumpsound2.PlaybackSpeed = random-0.3
- jumpsound2.Name = "JUMPSOUND2CLIENT"
- local lightimpact = Instance.new("Sound",ball)
- lightimpact.SoundId = "rbxassetid://9120885468"
- lightimpact.Volume = 1
- lightimpact.PlaybackSpeed = 1.3
- lightimpact.Name = "LIGHTIMPACTCLIENT"
- local heavyimpact1 = Instance.new("Sound",ball)
- heavyimpact1.SoundId = "rbxassetid://9119073573"
- heavyimpact1.Volume = 1
- heavyimpact1.PlaybackSpeed = 1
- heavyimpact1.Name = "HEAVYIMPACT1CLIENT"
- local heavyimpact2 = Instance.new("Sound",ball)
- heavyimpact2.SoundId = "rbxassetid://9119911864"
- heavyimpact2.Volume = 1
- heavyimpact2.PlaybackSpeed = 1
- heavyimpact2.Name = "HEAVYIMPACT2CLIENT"
- local heavyimpact3 = Instance.new("Sound",ball)
- heavyimpact3.SoundId = "rbxassetid://9120109021"
- heavyimpact3.Volume = 0.2
- heavyimpact3.PlaybackSpeed = 1
- heavyimpact3.Name = "HEAVYIMPACT3CLIENT"
- local heavyimpact4 = Instance.new("Sound",ball)
- heavyimpact4.SoundId = "rbxassetid://9120885468"
- heavyimpact4.Volume = 1
- heavyimpact4.PlaybackSpeed = 1
- heavyimpact4.Name = "HEAVYIMPACT4CLIENT"
- local roll1 = Instance.new("Sound",ball)
- roll1.SoundId = "rbxassetid://6560398360"
- roll1.Volume = 0
- roll1.PlaybackSpeed = 2
- roll1.Looped = true
- roll1.Name = "ROLL1CLIENT"
- local roll2 = Instance.new("Sound",ball)
- roll2.SoundId = "rbxassetid://9112904857"
- roll2.Volume = 0
- roll2.PlaybackSpeed = 1.2
- roll2.Looped = true
- roll2.Name = "ROLL2CLIENT"
- roll1:Play()
- roll2:Play()
- uis.InputBegan:Connect(function(input,gamepro)
- if not gamepro then
- if input.UserInputType == Enum.UserInputType.Keyboard then
- if input.KeyCode == Enum.KeyCode.W then
- w = true
- elseif input.KeyCode == Enum.KeyCode.S then
- s = true
- elseif input.KeyCode == Enum.KeyCode.A then
- a = true
- elseif input.KeyCode == Enum.KeyCode.D then
- d = true
- elseif input.KeyCode == Enum.KeyCode.Space then
- space = true
- end
- end
- end
- end)
- uis.InputEnded:Connect(function(input,gamepro)
- if not gamepro then
- if input.UserInputType == Enum.UserInputType.Keyboard then
- if input.KeyCode == Enum.KeyCode.W then
- w = false
- elseif input.KeyCode == Enum.KeyCode.S then
- s = false
- elseif input.KeyCode == Enum.KeyCode.A then
- a = false
- elseif input.KeyCode == Enum.KeyCode.D then
- d = false
- elseif input.KeyCode == Enum.KeyCode.Space then
- space = false
- end
- end
- end
- end)
- local park = Instance.new("Part",workspace)
- park.Anchored = true
- park.Size = Vector3.new(3,1,3)
- park.Transparency = 1
- park.CustomPhysicalProperties = PhysicalProperties.new(2.4030001163482666*1.25,1.5,0.5,1,1)
- local velocity = Vector3.new(0,0,0)
- local airborn = false
- local groundpart = nil
- local antispammer = false
- ball.Touched:Connect(function(part)
- if not antispammer and part.CanCollide then
- local y = math.abs(velocity.Y)
- local horizontalvelocity = Vector2.new(velocity.X,velocity.Z).Magnitude
- local zoomer = 0
- if y > 10 and not airborn then
- antispammer = true
- zoomer = y
- elseif horizontalvelocity > 4 and not airborn and part ~= park and part ~= groundpart then
- antispammer = true
- zoomer = horizontalvelocity
- elseif airborn and horizontalvelocity > 4 and horizontalvelocity > y then
- antispammer = true
- zoomer = horizontalvelocity
- elseif airborn and y > 14 and y >= horizontalvelocity then
- antispammer = true
- zoomer = y
- end
- if zoomer < 30 and zoomer ~= 0 then
- local ratio = zoomer/30
- if lightimpact == nil or lightimpact.Parent ~= ball then
- lightimpact = Instance.new("Sound",ball)
- lightimpact.SoundId = "rbxassetid://9120885468"
- lightimpact.Volume = 1
- lightimpact.PlaybackSpeed = 1.3
- lightimpact.Name = "LIGHTIMPACTCLIENT"
- end
- lightimpact.Volume = 1+ratio
- lightimpact.PlaybackSpeed = 1.3+(ratio/3)
- lightimpact:Play()
- remote:FireServer("SoftHit",{1+ratio,1.3+(ratio/3)})
- elseif zoomer ~= 0 then
- local ratio = math.clamp(zoomer/100,0,1)
- if heavyimpact1 == nil or heavyimpact1.Parent ~= ball then
- heavyimpact1 = Instance.new("Sound",ball)
- heavyimpact1.SoundId = "rbxassetid://9119073573"
- heavyimpact1.Volume = 1
- heavyimpact1.PlaybackSpeed = 1
- heavyimpact1.Name = "HEAVYIMPACT1CLIENT"
- end
- heavyimpact1.Volume = 1.25+(ratio/2)
- heavyimpact1.PlaybackSpeed = 1+(ratio/3)
- heavyimpact1:Play()
- if heavyimpact2 == nil or heavyimpact2.Parent ~= ball then
- heavyimpact2 = Instance.new("Sound",ball)
- heavyimpact2.SoundId = "rbxassetid://9119911864"
- heavyimpact2.Volume = 1
- heavyimpact2.PlaybackSpeed = 1
- heavyimpact2.Name = "HEAVYIMPACT2CLIENT"
- end
- heavyimpact2.Volume = 1.25+(ratio/2)
- heavyimpact2.PlaybackSpeed = 1+(ratio/3)
- heavyimpact2:Play()
- if heavyimpact3 == nil or heavyimpact3.Parent ~= ball then
- heavyimpact3 = Instance.new("Sound",ball)
- heavyimpact3.SoundId = "rbxassetid://9120109021"
- heavyimpact3.Volume = 0.2
- heavyimpact3.PlaybackSpeed = 1
- heavyimpact2.Name = "HEAVYIMPACT2CLIENT"
- end
- heavyimpact3.Volume = (1.25+(ratio/2))*0.2
- heavyimpact3.PlaybackSpeed = 1+(ratio/3)
- heavyimpact3:Play()
- if heavyimpact4 == nil or heavyimpact4.Parent ~= ball then
- heavyimpact4 = Instance.new("Sound",ball)
- heavyimpact4.SoundId = "rbxassetid://9120885468"
- heavyimpact4.Volume = 1
- heavyimpact4.PlaybackSpeed = 1
- heavyimpact4.Name = "HEAVYIMPACT4CLIENT"
- end
- heavyimpact4.Volume = 1.25+(ratio/2)
- heavyimpact4.PlaybackSpeed = 1+(ratio/3)
- heavyimpact4:Play()
- remote:FireServer("HardHit",{{1.25+(ratio/2),1+(ratio/3)},{1.25+(ratio/2),1+(ratio/3)},{(1.25+(ratio/2))*0.2,1+(ratio/3)},{1.25+(ratio/2),1+(ratio/3)}})
- end
- wait()
- antispammer = false
- end
- end)
- --ball:ApplyAngularImpulse(ball.AssemblyAngularVelocity + Vector3.new(math.rad(360),0,0))
- local detectoruwu = false
- local run = game:GetService("RunService")
- run.RenderStepped:Connect(function(tim)
- if owner.Character ~= nil then
- local hum = owner.Character:FindFirstChild("Humanoid")
- if hum ~= nil then
- owner.Character.Humanoid.WalkSpeed = 0
- owner.Character.Humanoid.UseJumpPower = true
- owner.Character.Humanoid.JumpPower = 0
- end
- end
- ball.CustomPhysicalProperties = PhysicalProperties.new(2.4030001163482666*1.25,1.5,0.3,1,1)
- cam.CameraSubject = ball
- local fps = 1/tim
- local ratio = fps/60
- local part = Instance.new("Part")
- local mass = 1--ball.AssemblyMass/10.06566333770752
- local rot = Vector3.new(0,0,0)
- if w then
- part.CFrame = cam.CFrame
- part.Orientation = Vector3.new(0,part.Orientation.Y,0)
- local cf1 = part.CFrame
- local cf2 = cf1 * CFrame.new(0,0,-1*mass)
- rot = rot + (cf2.Position - cf1.Position)
- end
- if s then
- part.CFrame = cam.CFrame
- part.Orientation = Vector3.new(0,part.Orientation.Y,0)
- local cf1 = part.CFrame
- local cf2 = cf1 * CFrame.new(0,0,1*mass)
- rot = rot + (cf2.Position - cf1.Position)
- end
- if a then
- part.CFrame = cam.CFrame
- part.Orientation = Vector3.new(0,part.Orientation.Y,0)
- local cf1 = part.CFrame
- local cf2 = cf1 * CFrame.new(-1*mass,0,0)
- rot = rot + (cf2.Position - cf1.Position)
- end
- if d then
- part.CFrame = cam.CFrame
- part.Orientation = Vector3.new(0,part.Orientation.Y,0)
- local cf1 = part.CFrame
- local cf2 = cf1 * CFrame.new(1*mass,0,0)
- rot = rot + (cf2.Position - cf1.Position)
- end
- local ray = workspace:Raycast(ball.Position,Vector3.new(0,ball.Size.Y*-1*0.5-0.35,0))
- local ray2 = Ray.new(ball.Position, Vector3.new(0, -500, 0))
- local part1 = Instance.new("Part")
- local part2 = Instance.new('Part')
- local function PointLocalVectorAt(objectSpaceVector, originPosition, lookAtPosition)
- return CFrame.new(originPosition, lookAtPosition)*CFrame.new(Vector3.new(), objectSpaceVector):inverse()
- end
- local testDistance = 100
- local part, hit, surfaceNormal = workspace:FindPartOnRayWithIgnoreList(ray2, {ball,park})
- local ySize = part2.Size.y
- local x, z = ball.Position.x, ball.Position.z
- local posn = hit + surfaceNormal*ySize/2
- local x0, y0, z0 = posn.X, posn.Y, posn.Z
- local y = -(surfaceNormal.x*(x - x0) + surfaceNormal.z*(z - z0))/surfaceNormal.y + y0
- local newPosition = Vector3.new(x, y, z)
- park.CFrame = PointLocalVectorAt(Vector3.new(0, 1, 0), newPosition, newPosition + surfaceNormal)
- park.CFrame = park.CFrame * CFrame.new(0,(park.Size.Y*-1-0.09),0)
- part1.CFrame = park.CFrame * CFrame.new(0,17,0)
- local maf = part1.Position-park.Position
- airborn = ray == nil
- if ray2 ~= nil then
- groundpart = part
- else
- groundpart = nil
- end
- if airborn and detectoruwu then
- detectoruwu = false
- remote:FireServer("InAir")
- elseif not airborn and not detectoruwu then
- detectoruwu = true
- remote:FireServer("OnGround")
- end
- if not airborn then
- cotime = tick()
- end
- if (((ray ~= nil) and ray.Instance.CanCollide) or (cotime+0.08333333333333333 > tick()) and tick() > cancotime) and space and ball.AssemblyLinearVelocity.Y > -17 and ball.AssemblyLinearVelocity.Y < 5 then
- if tick() > lastjump then
- lastjump = tick()+(0.15/2)
- cotime = tick()-2
- cancotime = tick()+0.5
- --JUMP
- --
- local random = math.random(900,1100)/1000
- if jumpsound1 == nil or jumpsound1.Parent ~= ball then
- jumpsound1 = Instance.new("Sound",ball)
- jumpsound1.SoundId = "rbxassetid://180204586"
- jumpsound1.Volume = 1
- jumpsound1.PlaybackSpeed = random*4
- jumpsound1.Name = "JUMPSOUND1CLIENT"
- end
- jumpsound1.SoundId = "rbxassetid://180204586"
- jumpsound1.Volume = 1
- jumpsound1.PlaybackSpeed = random*4
- if jumpsound2 == nil or jumpsound2.Parent ~= ball then
- jumpsound2 = Instance.new("Sound",ball)
- jumpsound2.SoundId = "rbxassetid://4560102662"
- jumpsound2.Volume = 1
- jumpsound2.PlaybackSpeed = random-0.3
- jumpsound2.Name = "JUMPSOUND2CLIENT"
- end
- jumpsound2.SoundId = "rbxassetid://4560102662"
- jumpsound2.Volume = 1
- jumpsound2.PlaybackSpeed = random-0.3
- jumpsound1:Play()
- jumpsound2:Play()
- remote:FireServer("JumpSound",{random*4,random-0.3})
- coroutine.resume(coroutine.create(function()
- wait()
- ball.AssemblyLinearVelocity = Vector3.new(ball.AssemblyLinearVelocity.X+maf.X,maf.Y,ball.AssemblyLinearVelocity.Z+maf.Z)
- end))
- end
- end
- if ball.AssemblyLinearVelocity.Y < -35 then
- lastjump = tick()+(0.15/2)
- ball.CustomPhysicalProperties = PhysicalProperties.new(2.4030001163482666*1.25,1.5,0.6,1,1)
- elseif ray ~= nil and ball.AssemblyLinearVelocity.Y == 0 then
- ball.CustomPhysicalProperties = PhysicalProperties.new(2.4030001163482666*1.25,1.5,2,1,1)
- end
- local ggg = math.max(1-(0.05 * tim/0.01666),0)
- ball:ApplyAngularImpulse(Vector3.new((rot.Z/3),0,((rot.X*-1)/3)) * Vector3.new(tim/0.01666,tim/0.01666,tim/0.01666))
- ball:ApplyImpulse(Vector3.new(((rot.X)/6),0,((rot.Z)/6)) * Vector3.new(tim/0.01666,tim/0.01666,tim/0.01666))
- if ray ~= nil then
- ball.AssemblyAngularVelocity = ball.AssemblyAngularVelocity * Vector3.new(ggg,ggg,ggg)
- else
- local ggg = math.max(1-(0.01 * tim/0.01666),0)
- ball.AssemblyAngularVelocity = ball.AssemblyAngularVelocity * Vector3.new(ggg,ggg,ggg)
- end
- velocity = ball.AssemblyLinearVelocity
- --ROLL
- if roll1 == nil or roll1.Parent ~= ball then
- roll1 = Instance.new("Sound",ball)
- roll1.SoundId = "rbxassetid://6560398360"
- roll1.Volume = 0
- roll1.PlaybackSpeed = 2
- roll1.Looped = true
- roll1.Name = "ROLL1CLIENT"
- roll1:Play()
- end
- if ray ~= nil then
- local tv = Vector2.new(velocity.X,velocity.Z).Magnitude
- local volume = math.clamp(tv/15,0,1)
- local playbackspeed = math.clamp((1.01^tv),1,5)
- roll1.Volume = volume
- roll1.PlaybackSpeed = playbackspeed*2
- --roll2.Volume = volume*0.2
- --roll2.PlaybackSpeed = playbackspeed*1.2
- else
- roll1.Volume = 0
- roll2.Volume = 0
- end
- end)
- runService = game:GetService("RunService")
- userInputService = game:GetService("UserInputService")
- debs = game:GetService("Debris")
- deltaa = Vector2.new(0,0)
- zoom = 10
- sens = 0.0125
- scale = 1
- offset = Instance.new("CFrameValue")
- firstperson = false
- zoomed = false
- enabled = true
- bingleberry = true
- fromview = CFrame.Angles(0,0,0) -- ANGLES ONLY
- lockonpart = nil
- lockonpartdata = CFrame.new(0,0,0)
- camerax = 0
- cameray = 0
- cam = workspace.CurrentCamera
- able = false
- cam.CameraType = Enum.CameraType.Scriptable
- function OnRenderStep()
- local delta = userInputService:GetMouseDelta()
- cam.CFrame = CFrame.new(0,0,0)
- cam.CFrame = CFrame.new(ball.Position + Vector3.new(0,ball.Size.Y/2,0))
- delta = Vector2.new((delta.X*sens),(delta.Y*sens))
- deltaa = delta*Vector2.new(-1,-1)
- camerax = camerax + deltaa.X
- cameray = cameray + deltaa.Y
- cam.CFrame = cam.CFrame * CFrame.Angles(0,camerax,0) * CFrame.Angles(cameray,0,0) * CFrame.new(0,0,(zoom * (scale/1)))
- end
- runService.RenderStepped:Connect(function()
- OnRenderStep()
- end)
- userInputService.InputBegan:Connect(function(input, gameProcessed)
- if input.UserInputType == Enum.UserInputType.MouseButton2 and not gameProcessed then
- userInputService.MouseBehavior = Enum.MouseBehavior.LockCurrentPosition
- end
- end)
- userInputService.InputEnded:Connect(function(input, gameProcessed)
- if input.UserInputType == Enum.UserInputType.MouseButton2 and not gameProcessed then
- userInputService.MouseBehavior = Enum.MouseBehavior.Default
- end
- end)
- userInputService.InputChanged:Connect(function(input, gameProcessed)
- if input.UserInputType == Enum.UserInputType.MouseWheel then
- if not zoomed then
- if zoom + (input.Position.Z * -1 * (zoom/7)) >= 0 then
- if true then
- zoom = zoom + input.Position.Z * -1 * (zoom/7)
- end
- end
- end
- end
- end)
- while true do
- local player = owner
- local char = owner.Character
- local torso = char:FindFirstChild("HumanoidRootPart")
- local seleted = false
- local pos, gyro;
- local UserInputService = game:GetService("UserInputService")
- local dinosaur = Instance.new("HopperBin",owner.Backpack)
- dinosaur.Name = "Ball Fly"
- dinosaur.Selected:connect(function(mouse)
- selected = true
- pos = Instance.new("BodyPosition", ball)
- pos.maxForce = Vector3.new(1,1,1) * 1e99
- pos.position = ball.Position
- local angle = CFrame.new()
- touchstart = UserInputService.TouchStarted:connect(function()
- button_up = false
- angle = CFrame.Angles(-math.rad(70),0,0)
- coroutine.resume(coroutine.create(function()
- while not button_up do
- pos.position = pos.position + (mouse.Hit.p - cam.CFrame.Position).unit * 10
- wait()
- end
- end))
- end)
- touchend = UserInputService.TouchEnded:connect(function()
- button_up = true
- angle = CFrame.new()
- end)
- mouse.Button1Down:connect(function()
- local button_up = false
- angle = CFrame.Angles(-math.rad(70),0,0)
- coroutine.resume(coroutine.create(function()
- while not button_up do
- pos.position = pos.position + (mouse.Hit.p - cam.CFrame.Position).unit * 10
- wait()
- end
- end))
- mouse.Button1Up:wait()
- button_up = true
- angle = CFrame.new()
- end)
- end)
- dinosaur.Deselected:connect(function()
- selected = false
- touchstart:disconnect()
- touchend:Disconnect()
- pos:Destroy()
- end)
- repeat wait(.1) until char == nil or char.Parent == nil or char ~= owner.Character
- if pos ~= nil then
- pos:Destroy()
- end
- end]],gui)
Add Comment
Please, Sign In to add comment