SHOW:
|
|
- or go back to the newest paste.
| 1 | wait(); | |
| 2 | ||
| 3 | local user=game:service'Players'.LocalPlayer; | |
| 4 | local char=user.Character; | |
| 5 | local hum=char.Humanoid; | |
| 6 | local head=char.Head; | |
| 7 | ||
| 8 | for i,v in ipairs{user.Backpack,char}do
| |
| 9 | for i,v in ipairs(v:children())do | |
| 10 | if(v.Name=='ala_ball')then | |
| 11 | v:Destroy(); | |
| 12 | end; | |
| 13 | end; | |
| 14 | end; | |
| 15 | ||
| 16 | local bin=Instance.new('HopperBin',user.Backpack);
| |
| 17 | bin.Name='mad_ball'; | |
| 18 | script.Parent=bin; | |
| 19 | ||
| 20 | local function raycasting(pos,dir) | |
| 21 | local ray=Ray.new(pos,dir); | |
| 22 | return workspace:FindPartOnRay(ray,char,false)or workspace:FindPartOnRay(ray,char,true); | |
| 23 | end; | |
| 24 | ||
| 25 | local function HSV(H,S,V) | |
| 26 | H = H % 360 | |
| 27 | local C = V * S | |
| 28 | local H2 = H/60 | |
| 29 | local X = C * (1 - math.abs((H2 %2) -1)) | |
| 30 | local color = Color3.new(0,0,0) | |
| 31 | if H2 <= 0 then | |
| 32 | color = Color3.new(C,0,0) | |
| 33 | elseif 0 <= H2 and H2 <= 1 then | |
| 34 | color = Color3.new(C,X,0) | |
| 35 | elseif 1 <= H2 and H2 <= 2 then | |
| 36 | color = Color3.new(X,C,0) | |
| 37 | elseif 2 <= H2 and H2 <= 3 then | |
| 38 | color = Color3.new(0,C,X) | |
| 39 | elseif 3 <= H2 and H2 <= 4 then | |
| 40 | color = Color3.new(0,X,C) | |
| 41 | elseif 4 <= H2 and H2 <= 5 then | |
| 42 | color = Color3.new(X,0,C) | |
| 43 | elseif 5 <= H2 and H2 <= 6 then | |
| 44 | color = Color3.new(C,0,X) | |
| 45 | end | |
| 46 | local m = V - C | |
| 47 | return Color3.new(color.r + m, color.g + m, color.b + m) | |
| 48 | end | |
| 49 | ||
| 50 | bin.Selected:connect(function(mouse) | |
| 51 | local hue = 0 | |
| 52 | local colur = 0 | |
| 53 | local keys={};
| |
| 54 | ||
| 55 | mouse.KeyDown:connect(function(key) | |
| 56 | keys[key]=true; | |
| 57 | end); | |
| 58 | ||
| 59 | mouse.KeyUp:connect(function(key) | |
| 60 | keys[key]=false; | |
| 61 | end); | |
| 62 | ||
| 63 | game:service'SoundService'.DistanceFactor = 50 | |
| 64 | game:service'SoundService'.DopplerScale=0 | |
| 65 | ||
| 66 | local speed=7; | |
| 67 | local max_speed=150; | |
| 68 | ||
| 69 | hum.MaxHealth = math.huge | |
| 70 | ||
| 71 | local part=Instance.new'Part'; | |
| 72 | part.Shape=0; | |
| 73 | part.Friction=10; | |
| 74 | part.Elasticity=1; | |
| 75 | part.TopSurface=0; | |
| 76 | part.FormFactor=0; | |
| 77 | part.Anchored=true; | |
| 78 | part.BottomSurface=0; | |
| 79 | part.Name='ala_ball'; | |
| 80 | part.CanCollide=false; | |
| 81 | part.Transparency=1; | |
| 82 | part.CFrame=head.CFrame; | |
| 83 | part.Size=Vector3.new(10,10,10); | |
| 84 | part.Parent=char; | |
| 85 | local weld=Instance.new('Weld',part);
| |
| 86 | weld.Part0=part; | |
| 87 | weld.Part1=head; | |
| 88 | part.Anchored=false; | |
| 89 | part.CanCollide=true; | |
| 90 | hum.PlatformStand=true; | |
| 91 | local sound=Instance.new('Sound',head);
| |
| 92 | sound.SoundId='rbxassetid://177078299'; | |
| 93 | sound.Volume=1; | |
| 94 | sound.Looped=true; | |
| 95 | sound:play(); | |
| 96 | for i,v in ipairs(char:children()) do | |
| 97 | if v:IsA'Part' then | |
| 98 | v.Transparency=1; | |
| 99 | end | |
| 100 | end | |
| 101 | local PointLight = Instance.new('PointLight',head)
| |
| 102 | PointLight.Range = 20 | |
| 103 | local bbg = Instance.new('BillboardGui',head)
| |
| 104 | bbg.Adornee=head | |
| 105 | bbg.Size=UDim2.new(8,0,8,0) | |
| 106 | local img = Instance.new('ImageLabel',bbg)
| |
| 107 | img.BackgroundTransparency=1 | |
| 108 | img.Size=UDim2.new(1,0,1,0) | |
| 109 | img.Image='rbxassetid://185945467' | |
| 110 | coroutine.wrap(function() | |
| 111 | while (part.Parent) do | |
| 112 | pcall(function() | |
| 113 | img.Image='rbxassetid://185945467' | |
| 114 | end) | |
| 115 | wait() | |
| 116 | pcall(function() | |
| 117 | img.Image='rbxassetid://185945486' | |
| 118 | end) | |
| 119 | wait() | |
| 120 | pcall(function() | |
| 121 | img.Image='rbxassetid://185945493' | |
| 122 | end) | |
| 123 | wait() | |
| 124 | pcall(function() | |
| 125 | img.Image='rbxassetid://185945515' | |
| 126 | end) | |
| 127 | wait() | |
| 128 | pcall(function() | |
| 129 | img.Image='rbxassetid://185945527' | |
| 130 | end) | |
| 131 | wait() | |
| 132 | pcall(function() | |
| 133 | img.Image='rbxassetid://185945553' | |
| 134 | end) | |
| 135 | wait() | |
| 136 | pcall(function() | |
| 137 | img.Image='rbxassetid://185945573' | |
| 138 | end) | |
| 139 | wait() | |
| 140 | pcall(function() | |
| 141 | img.Image='rbxassetid://185945586' | |
| 142 | end) | |
| 143 | wait() | |
| 144 | pcall(function() | |
| 145 | img.Image='rbxassetid://185945612' | |
| 146 | end) | |
| 147 | wait() | |
| 148 | pcall(function() | |
| 149 | img.Image='rbxassetid://185945634' | |
| 150 | end) | |
| 151 | wait() | |
| 152 | end | |
| 153 | end)() | |
| 154 | while(part.Parent)do | |
| 155 | if(keys[' ']and raycasting(part.Position,Vector3.new(0,-10,0)))then | |
| 156 | part.Velocity=part.Velocity+Vector3.new(0,30,0); | |
| 157 | end; | |
| 158 | ||
| 159 | if(keys.w or keys.a or keys.s or keys.d)then | |
| 160 | local r=-math.pi/2; | |
| 161 | ||
| 162 | if(keys.s)then | |
| 163 | r=r-math.pi; | |
| 164 | end; | |
| 165 | ||
| 166 | if(keys.a)then | |
| 167 | if(keys.w)then | |
| 168 | r=r-math.pi/4; | |
| 169 | elseif(keys.s)then | |
| 170 | r=r+math.pi/4; | |
| 171 | else | |
| 172 | r=r-math.pi/2; | |
| 173 | end; | |
| 174 | end; | |
| 175 | ||
| 176 | if(keys.d)then | |
| 177 | if(keys.w)then | |
| 178 | r=r+math.pi/4; | |
| 179 | elseif(keys.s)then | |
| 180 | r=r-math.pi/4; | |
| 181 | else | |
| 182 | r=r+math.pi/2; | |
| 183 | end; | |
| 184 | end; | |
| 185 | ||
| 186 | local cam=workspace.CurrentCamera; | |
| 187 | local crd=cam.CoordinateFrame; | |
| 188 | local dir=(crd.lookVector*Vector3.new(1,0,1)).unit; | |
| 189 | local x=dir.x; | |
| 190 | local z=dir.z; | |
| 191 | local dir=Vector3.new( | |
| 192 | math.cos(r)*x-math.sin(r)*z, | |
| 193 | 0, | |
| 194 | math.sin(r)*x+math.cos(r)*z | |
| 195 | ); | |
| 196 | part.RotVelocity=dir*speed; | |
| 197 | speed=math.min(max_speed,speed+2/speed); | |
| 198 | else | |
| 199 | speed=math.min(math.abs(part.Velocity.magnitude/5),max_speed); | |
| 200 | end; | |
| 201 | wait(); | |
| 202 | hue = ((hue+25)%360) | |
| 203 | colur = HSV(hue,1,1) | |
| 204 | PointLight.Color = Color3.new(colur.r,colur.g,colur.b) | |
| 205 | end; | |
| 206 | pcall(function() | |
| 207 | bbg:Destroy() | |
| 208 | end) | |
| 209 | pcall(function() | |
| 210 | sound:Destroy() | |
| 211 | end) | |
| 212 | pcall(function() | |
| 213 | PointLight:Destroy() | |
| 214 | end) | |
| 215 | ||
| 216 | end); | |
| 217 | ||
| 218 | bin.Deselected:connect(function() | |
| 219 | hum.PlatformStand=false; | |
| 220 | for i,v in ipairs(char:children())do | |
| 221 | if(v.Name=='ala_ball')then | |
| 222 | v:Destroy(); | |
| 223 | end; | |
| 224 | end; | |
| 225 | for i,v in ipairs(char:children()) do | |
| 226 | if v:IsA'Part' then | |
| 227 | v.Transparency=0; | |
| 228 | end | |
| 229 | end | |
| 230 | hum.MaxHealth = 100 | |
| 231 | char:findFirstChild'HumanoidRootPart'.Transparency=1 | |
| 232 | game:service'SoundService'.DistanceFactor = 10 | |
| 233 | game:service'SoundService'.DopplerScale=1 | |
| 234 | end); |