SHOW:
|
|
- or go back to the newest paste.
| 1 | --just put this on the top of a script and boom 89% works | |
| 2 | --note this does not work on big scripts | |
| 3 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
| |
| 4 | local Player,game,owner = owner,game | |
| 5 | local RealPlayer = Player | |
| 6 | do | |
| 7 | local rp = RealPlayer | |
| 8 | script.Parent = rp.Character | |
| 9 | ||
| 10 | --RemoteEvent for communicating | |
| 11 | local Event = Instance.new("RemoteEvent")
| |
| 12 | Event.Name = "UserInput_Event" | |
| 13 | ||
| 14 | --Fake event to make stuff like Mouse.KeyDown work | |
| 15 | local function fakeEvent() | |
| 16 | local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
| |
| 17 | t.connect = t.Connect | |
| 18 | return t | |
| 19 | end | |
| 20 | ||
| 21 | --Creating fake input objects with fake variables | |
| 22 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
| |
| 23 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
| |
| 24 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
| |
| 25 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
| |
| 26 | end} | |
| 27 | --Merged 2 functions into one by checking amount of arguments | |
| 28 | CAS.UnbindAction = CAS.BindAction | |
| 29 | ||
| 30 | --This function will trigger the events that have been :Connect()'ed | |
| 31 | local function te(self,ev,...) | |
| 32 | local t = m[ev] | |
| 33 | if t and t._fakeEvent then | |
| 34 | for _,f in pairs(t.Functions) do | |
| 35 | f(...) | |
| 36 | end | |
| 37 | end | |
| 38 | end | |
| 39 | m.TrigEvent = te | |
| 40 | UIS.TrigEvent = te | |
| 41 | ||
| 42 | Event.OnServerEvent:Connect(function(plr,io) | |
| 43 | if plr~=rp then return end | |
| 44 | m.Target = io.Target | |
| 45 | m.Hit = io.Hit | |
| 46 | if not io.isMouse then | |
| 47 | local b = io.UserInputState == Enum.UserInputState.Begin | |
| 48 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
| 49 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
| 50 | end | |
| 51 | for _,t in pairs(CAS.Actions) do | |
| 52 | for _,k in pairs(t.Keys) do | |
| 53 | if k==io.KeyCode then | |
| 54 | t.Function(t.Name,io.UserInputState,io) | |
| 55 | end | |
| 56 | end | |
| 57 | end | |
| 58 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
| 59 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
| 60 | end | |
| 61 | end) | |
| 62 | Event.Parent = NLS([==[ | |
| 63 | local Player = game:GetService("Players").LocalPlayer
| |
| 64 | local Event = script:WaitForChild("UserInput_Event")
| |
| 65 | ||
| 66 | local Mouse = Player:GetMouse() | |
| 67 | local UIS = game:GetService("UserInputService")
| |
| 68 | local input = function(io,a) | |
| 69 | if a then return end | |
| 70 | --Since InputObject is a client-side instance, we create and pass table instead | |
| 71 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
| |
| 72 | end | |
| 73 | UIS.InputBegan:Connect(input) | |
| 74 | UIS.InputEnded:Connect(input) | |
| 75 | ||
| 76 | local h,t | |
| 77 | --Give the server mouse data 30 times every second, but only if the values changed | |
| 78 | --If player is not moving their mouse, client won't fire events | |
| 79 | while wait(1/30) do | |
| 80 | if h~=Mouse.Hit or t~=Mouse.Target then | |
| 81 | h,t=Mouse.Hit,Mouse.Target | |
| 82 | Event:FireServer({isMouse=true,Target=t,Hit=h})
| |
| 83 | end | |
| 84 | end]==],Player.Character) | |
| 85 | ||
| 86 | ----Sandboxed game object that allows the usage of client-side methods and services | |
| 87 | --Real game object | |
| 88 | local _rg = game | |
| 89 | ||
| 90 | --Metatable for fake service | |
| 91 | local fsmt = {
| |
| 92 | __index = function(self,k) | |
| 93 | local s = rawget(self,"_RealService") | |
| 94 | if s then return s[k] end | |
| 95 | end, | |
| 96 | __newindex = function(self,k,v) | |
| 97 | local s = rawget(self,"_RealService") | |
| 98 | if s then s[k]=v end | |
| 99 | end, | |
| 100 | __call = function(self,...) | |
| 101 | local s = rawget(self,"_RealService") | |
| 102 | if s then return s(...) end | |
| 103 | end | |
| 104 | } | |
| 105 | local function FakeService(t,RealService) | |
| 106 | t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService | |
| 107 | return setmetatable(t,fsmt) | |
| 108 | end | |
| 109 | ||
| 110 | --Fake game object | |
| 111 | local g = {
| |
| 112 | GetService = function(self,s) | |
| 113 | return self[s] | |
| 114 | end, | |
| 115 | Players = FakeService({
| |
| 116 | LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
| |
| 117 | },"Players"), | |
| 118 | UserInputService = FakeService(UIS,"UserInputService"), | |
| 119 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
| 120 | } | |
| 121 | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) | |
| 122 | g.service = g.GetService | |
| 123 | ||
| 124 | g.RunService = FakeService({
| |
| 125 | RenderStepped = _rg:GetService("RunService").Heartbeat,
| |
| 126 | BindToRenderStep = function(self,name,_,fun) | |
| 127 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
| 128 | end, | |
| 129 | UnbindFromRenderStep = function(self,name) | |
| 130 | self._btrs[name]:Disconnect() | |
| 131 | end, | |
| 132 | },"RunService") | |
| 133 | ||
| 134 | setmetatable(g,{
| |
| 135 | __index=function(self,s) | |
| 136 | return _rg:GetService(s) or typeof(_rg[s])=="function" | |
| 137 | and function(_,...)return _rg[s](_rg,...)end or _rg[s] | |
| 138 | end, | |
| 139 | __newindex = fsmt.__newindex, | |
| 140 | __call = fsmt.__call | |
| 141 | }) | |
| 142 | --Changing owner to fake player object to support owner:GetMouse() | |
| 143 | game,owner = g,g.Players.LocalPlayer | |
| 144 | end | |
| 145 | ||
| 146 | ||
| 147 | ||
| 148 | local plr = game.Players.LocalPlayer | |
| 149 | local chr = plr.Character | |
| 150 | local maus = plr:GetMouse() | |
| 151 | local PGui=plr.PlayerGui | |
| 152 | local lleg = chr["Left Leg"] | |
| 153 | local rleg = chr["Right Leg"] | |
| 154 | local larm = chr["Left Arm"] | |
| 155 | local rarm = chr["Right Arm"] | |
| 156 | local hed = chr.Head | |
| 157 | local rutprt = chr.HumanoidRootPart | |
| 158 | local torso = chr.Torso | |
| 159 | local otheranims=false | |
| 160 | local armmovement=false | |
| 161 | chr.Animate.Disabled=true | |
| 162 | local RunSpeed=36 | |
| 163 | local WlkSpeed=18 | |
| 164 | local runnin=false | |
| 165 | local tik=0 | |
| 166 | local rollvalue=0 | |
| 167 | local swimming=false | |
| 168 | local fldb={['w']=false,['a']=false,['s']=false,['d']=false}
| |
| 169 | local jumpval=0 | |
| 170 | local idlerollv=0 | |
| 171 | - | splm.Scale=Vector3.new(a,a,a) splash.Transparency=splash.Transparency+.05 splash.CFrame=splash.CFrame+Vector3.new(0,.05,0) wait'' end |
| 171 | + | |
| 172 | local BallColor=torso.BrickColor | |
| 173 | local BallTransparency=0 | |
| 174 | local BallReflectance=0 | |
| 175 | local BallMaterial="Neon" | |
| 176 | ||
| 177 | ||
| 178 | ||
| 179 | coroutine.wrap(function() | |
| 180 | for i,x in pairs(hed:GetChildren()) do if x:IsA('Sound') then x:Destroy() end end end)()
| |
| 181 | function Lerp(a, b, i) | |
| 182 | local com1 = {a.X, a.Y, a.Z, a:toEulerAnglesXYZ()}
| |
| 183 | local com2 = {b.X, b.Y, b.Z, b:toEulerAnglesXYZ()}
| |
| 184 | local calx = com1[1] + (com2[1] - com1[1]) * i | |
| 185 | local caly = com1[2] + (com2[2] - com1[2]) * i | |
| 186 | local calz = com1[3] + (com2[3] - com1[3]) * i | |
| 187 | local cala = com1[4] + (com2[4] - com1[4]) * i | |
| 188 | local calb = com1[5] + (com2[5] - com1[5]) * i | |
| 189 | local calc = com1[6] + (com2[6] - com1[6]) * i | |
| 190 | return CFrame.new(calx, caly, calz) * CFrame.Angles(cala, calb, calc) | |
| 191 | end | |
| 192 | function TwnSingleNumber(s,f,m) | |
| 193 | local wot=s+(f-s)*m | |
| 194 | return wot | |
| 195 | end | |
| 196 | function TwnVector3(q,w,e) | |
| 197 | local begin={q.x,q.y,q.z}
| |
| 198 | local ending={w.x,w.y,w.z}
| |
| 199 | local bgx=begin[1]+(ending[1]-begin[1])*e | |
| 200 | local bgy=begin[2]+(ending[2]-begin[2])*e | |
| 201 | local bgz=begin[3]+(ending[3]-begin[3])*e | |
| 202 | return Vector3.new(bgx,bgy,bgz) | |
| 203 | end | |
| 204 | newWeld = function(wld, wp0, wp1, wc0x, wc0y, wc0z) | |
| 205 | wld = Instance.new("Weld", wp1)
| |
| 206 | wld.Part0 = wp0 | |
| 207 | wld.Part1 = wp1 | |
| 208 | wld.C0 = CFrame.new(wc0x, wc0y, wc0z) | |
| 209 | end | |
| 210 | function Avg(a, b) | |
| 211 | return CFrame.new((a.X+b.X)/2,(a.Y+b.Y)/2,(a.Z+b.Z)/2) | |
| 212 | end | |
| 213 | ||
| 214 | local jump=Instance.new('Sound',rutprt)
| |
| 215 | jump.Volume=.2 | |
| 216 | jump.Pitch=1 | |
| 217 | jump.SoundId='http://www.roblox.com/asset?id=170588191' | |
| 218 | ||
| 219 | newWeld(law, torso, larm, -1.5, 0.5, 0) | |
| 220 | newWeld(raw, torso, rarm, 1.5, 0.5, 0) | |
| 221 | newWeld(llw, torso, lleg, -.5, -2, 0) | |
| 222 | newWeld(rlw, torso, rleg, .5, -2, 0) | |
| 223 | newWeld(hw, torso, hed, 0, 1.5, 0) | |
| 224 | local rutwald=Instance.new('Weld',rutprt)
| |
| 225 | rutwald.Part0=rutprt | |
| 226 | rutwald.Part1=torso | |
| 227 | larm.Weld.C1 = CFrame.new(0, 0.5, 0) | |
| 228 | rarm.Weld.C1 = CFrame.new(0, 0.5, 0) | |
| 229 | rleg.Weld.C1=CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),0,0) | |
| 230 | lleg.Weld.C1=CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),0,0) | |
| 231 | ||
| 232 | local anim = "Idling" | |
| 233 | local lastanim = "Idling" | |
| 234 | local val = 0 | |
| 235 | local syne = 0 | |
| 236 | local num = 0 | |
| 237 | local runtime = 0 | |
| 238 | ||
| 239 | maus.KeyDown:connect(function(kei) | |
| 240 | if string.byte(kei)==48 and not otheranims and not sitting and not disabled then | |
| 241 | runnin=true | |
| 242 | end | |
| 243 | if kei=='w' then fldb.w=true end | |
| 244 | if kei=='a' then fldb.a=true end | |
| 245 | if kei=='s' then fldb.s=true end | |
| 246 | if kei=='d' then fldb.d=true end | |
| 247 | end) | |
| 248 | maus.KeyUp:connect(function(kei) | |
| 249 | if string.byte(kei)==48 and not otheranims and not sitting and not disabled then | |
| 250 | runnin=false | |
| 251 | end | |
| 252 | if kei=='w' then fldb.w=false end | |
| 253 | if kei=='a' then fldb.a=false end | |
| 254 | if kei=='s' then fldb.s=false end | |
| 255 | if kei=='d' then fldb.d=false end | |
| 256 | end) | |
| 257 | ||
| 258 | local bawl=Instance.new("Part",torso)
| |
| 259 | bawl.formFactor="Custom" | |
| 260 | bawl.Shape="Ball" | |
| 261 | bawl.BrickColor=(BallColor or torso.BrickColor) | |
| 262 | bawl.Material=BallMaterial | |
| 263 | bawl.Transparency=(BallTransparency or 0) | |
| 264 | bawl.Reflectance=(BallReflectance or 0) | |
| 265 | bawl.Size=Vector3.new(5.35,5.35,5.35) | |
| 266 | bawl.TopSurface=10 | |
| 267 | bawl.BottomSurface=10 | |
| 268 | bawl.LeftSurface=10 | |
| 269 | bawl.RightSurface=10 | |
| 270 | bawl.FrontSurface=10 | |
| 271 | bawl.BackSurface=10 | |
| 272 | bawl.Anchored=false | |
| 273 | bawl:breakJoints'' | |
| 274 | bawl.Locked=true | |
| 275 | bawl.CanCollide=true | |
| 276 | --[[local bawlmesh=Instance.new("SpecialMesh",bawl)
| |
| 277 | bawlmesh.MeshId="http://www.roblox.com/asset/?id=1527559" | |
| 278 | --bawlmesh.TextureId="http://www.roblox.com/asset?id=25701026" | |
| 279 | bawlmesh.Scale=Vector3.new(2.35,2.35,2.35)]] | |
| 280 | local bawllight=Instance.new("PointLight",bawl)
| |
| 281 | bawllight.Brightness=1 | |
| 282 | bawllight.Range=15 | |
| 283 | bawllight.Color=bawl.BrickColor.Color | |
| 284 | bawllight.Shadows=true | |
| 285 | local bawlweld=Instance.new("Weld",bawl)
| |
| 286 | bawlweld.Part0=rutprt | |
| 287 | bawlweld.Part1=bawl | |
| 288 | bawlweld.C1=CFrame.new(0,0,0) | |
| 289 | rutprt.Weld.C1=CFrame.new(0,-bawl.Size.y,0)*CFrame.Angles(math.rad(0),math.rad(0),0) | |
| 290 | ||
| 291 | chr.Humanoid.Swimming:connect(function(speedpls) | |
| 292 | if speedpls>=5 and not otheranims and not disabled and not sitting then | |
| 293 | swimming=true | |
| 294 | anim="Swimming" | |
| 295 | elseif speedpls<5 and not otheranims and not disabled and not sitting then | |
| 296 | swimming=false | |
| 297 | end | |
| 298 | end) | |
| 299 | ||
| 300 | coroutine.resume(coroutine.create(function() | |
| 301 | while true do | |
| 302 | if trailing then | |
| 303 | local Ray=Ray.new(rutprt.CFrame.p,(rutprt.CFrame.p-(rutprt.CFrame*CFrame.new(0,-2,0)).p).unit*-5) | |
| 304 | local hitbrick,hitposition=Workspace:FindPartOnRay(Ray,chr) | |
| 305 | if hitbrick and hitposition then | |
| 306 | local splash=Instance.new("Part",bawl)
| |
| 307 | splash.Anchored=true | |
| 308 | splash.CanCollide=false | |
| 309 | splash.Transparency=0 | |
| 310 | splash.formFactor="Custom" | |
| 311 | splash.BrickColor=hitbrick.BrickColor | |
| 312 | splash.Material=hitbrick.Material | |
| 313 | splash.Size=Vector3.new(2,2,2) | |
| 314 | game:service'Debris':AddItem(splash,2) | |
| 315 | splash.CFrame=CFrame.new(hitposition)*CFrame.Angles(math.random(1,3),math.random(1,3),math.random(1,3)) | |
| 316 | local splm=Instance.new("BlockMesh",splash)
| |
| 317 | coroutine.wrap(function() | |
| 318 | for a=0,1,.05 do | |
| 319 | splm.Scale=Vector3.new(a,a,a) splash.Transparency=splash.Transparency+0 splash.CFrame=splash.CFrame+Vector3.new(0,.05,0) wait'' end | |
| 320 | end)() | |
| 321 | end | |
| 322 | wait'' | |
| 323 | else | |
| 324 | wait'' | |
| 325 | end | |
| 326 | end | |
| 327 | end)) | |
| 328 | ||
| 329 | game:service'RunService'.RenderStepped:connect(function() | |
| 330 | syne=syne+1 | |
| 331 | if not otheranims and not swimming then | |
| 332 | if (torso.Velocity*Vector3.new(1, 0, 1)).magnitude < 1 and not dnc and not chr.Humanoid.Jump then-- and torso.Velocity.y<5 and torso.Velocity.y>-5 | |
| 333 | anim="Idling" | |
| 334 | ||
| 335 | elseif (rutprt.Velocity*Vector3.new(1, 0, 1)).magnitude > 1 and (rutprt.Velocity*Vector3.new(1, 0, 1)).magnitude < RunSpeed-5 and not chr.Humanoid.Jump then-- and torso.Velocity.y<5 and torso.Velocity.y>-5 | |
| 336 | anim="Walking" | |
| 337 | dnc=false | |
| 338 | ||
| 339 | elseif (torso.Velocity*Vector3.new(1, 0, 1)).magnitude > RunSpeed-10 and not chr.Humanoid.Jump then-- and torso.Velocity.y<5 and torso.Velocity.y>-5 | |
| 340 | anim="Sprinting" | |
| 341 | dnc=false | |
| 342 | ||
| 343 | elseif torso.Velocity.y>5 and chr.Humanoid.Jump then | |
| 344 | anim='Jumping' | |
| 345 | dnc=false | |
| 346 | ||
| 347 | elseif (torso.Velocity.y < -5) and chr.Humanoid.Jump then | |
| 348 | anim='Falling' | |
| 349 | dnc=false | |
| 350 | ||
| 351 | end | |
| 352 | end | |
| 353 | ||
| 354 | if anim~=lastanim then runtime=0 end | |
| 355 | lastanim=anim | |
| 356 | ||
| 357 | if anim=="Idling" then | |
| 358 | trailing=false | |
| 359 | if not armmovement then | |
| 360 | rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.5,.525+math.cos(syne/32.5)/25,0)*CFrame.Angles(0,0,math.rad(3)),.1) | |
| 361 | larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.5,.525+math.cos(syne/32.5)/25,0)*CFrame.Angles(0,0,math.rad(-3)),.1) | |
| 362 | end | |
| 363 | lleg.Weld.C0=Lerp(lleg.Weld.C0,CFrame.new(-.55,-1.9-math.cos(syne/32.5)/20,(math.cos(syne/32.5)/35))*CFrame.Angles(-(math.cos(syne/32.5)/35),0,math.rad(-2.5)),.1) | |
| 364 | rleg.Weld.C0=Lerp(rleg.Weld.C0,CFrame.new(.55,-1.9-math.cos(syne/32.5)/20,(math.cos(syne/32.5)/35))*CFrame.Angles(-(math.cos(syne/32.5)/35),0,math.rad(2.5)),.1) | |
| 365 | hed.Weld.C0=Lerp(hed.Weld.C0,CFrame.new(0,1.5+math.cos(syne/32.5)/50,0)*CFrame.Angles(math.cos(syne/32.5)/40,0,0),.1) | |
| 366 | rutprt.Weld.C0=Lerp(rutprt.Weld.C0,CFrame.new(0,-.4,-math.cos(syne/25)*3)*CFrame.Angles(math.cos(syne/25)/4,math.rad(0),math.rad(0)),.1) | |
| 367 | bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,-math.cos(syne/25)*3)*CFrame.Angles(math.rad(rollvalue),0,0),.25) | |
| 368 | end | |
| 369 | ||
| 370 | ||
| 371 | if anim=="Walking" then | |
| 372 | trailing=true | |
| 373 | rollvalue=rollvalue+3 | |
| 374 | if rollvalue>=359 then rollvalue=0 bawlweld.C0=CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/4)/5)) | |
| 375 | elseif rollvalue>=177 and rollvalue<=183 then rollvalue=184 bawlweld.C0=CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/4)/5)) | |
| 376 | else | |
| 377 | bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/4)/5)),.2) end | |
| 378 | if not armmovement then | |
| 379 | rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.5,.525-math.cos(syne/8)/6,math.cos(syne/8)/6)*CFrame.Angles(-math.cos(syne/8)/3+math.rad(25),0,math.rad(12.5)),.1) | |
| 380 | larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.5,.525+math.cos(syne/8)/6,-math.cos(syne/8)/6)*CFrame.Angles(math.cos(syne/8)/3+math.rad(25),0,math.rad(-12.5)),.1) | |
| 381 | end | |
| 382 | ||
| 383 | lleg.Weld.C0=Lerp(lleg.Weld.C0,CFrame.new(-(math.cos(syne/8)/11)-.5,-1.7+math.sin(syne/4)/3.5-math.cos(syne/8)/4,math.rad(-5)-(math.cos(syne/8)))*CFrame.Angles(math.rad(5)+(math.cos(syne/8)),0,-(math.cos(syne/8)/11)+math.rad(1)),.1) | |
| 384 | ||
| 385 | rleg.Weld.C0=Lerp(rleg.Weld.C0,CFrame.new(-(math.cos(syne/8)/11)+.5,-1.7-math.sin(syne/4)/3.5+math.cos(syne/8)/4,math.rad(-5)+(math.cos(syne/8)))*CFrame.Angles(math.rad(5)-(math.cos(syne/8)),0,-(math.cos(syne/8)/11)+math.rad(-1)),.1) | |
| 386 | ||
| 387 | rutprt.Weld.C0=Lerp(rutprt.Weld.C0,CFrame.new(0,-.5-math.cos(syne/4)/2,-math.cos(syne/4)*1.5)*CFrame.Angles(math.cos(syne/4)/10+math.rad(-5),math.cos(syne/4)/10,math.cos(syne/8)/10+math.sin(rutprt.RotVelocity.y/2)/10),.1) | |
| 388 | end | |
| 389 | ||
| 390 | if anim=="Sprinting" then | |
| 391 | trailing=true | |
| 392 | rollvalue=rollvalue+5 | |
| 393 | if rollvalue>=359 then rollvalue=0 bawlweld.C0=CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5)) | |
| 394 | elseif rollvalue>=177 and rollvalue<=183 then rollvalue=184 bawlweld.C0=CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5)) | |
| 395 | else | |
| 396 | bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5)),.2) end | |
| 397 | if not armmovement then | |
| 398 | rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.5,.525-math.cos(syne/6)/6,math.sin(syne/6)/5)*CFrame.Angles(-math.cos(syne/6)/3+math.rad(25),0,math.rad(12.5)),.1) | |
| 399 | larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.5,.525+math.cos(syne/6)/6,-math.sin(syne/6)/5)*CFrame.Angles(math.cos(syne/6)/3+math.rad(25),0,math.rad(-12.5)),.1) | |
| 400 | end | |
| 401 | ||
| 402 | lleg.Weld.C0=Lerp(lleg.Weld.C0,CFrame.new(-(math.cos(syne/6)/11)-.575,-1.7+math.cos(syne/3)/4-math.cos(syne/6)/4,math.rad(-5)-(math.cos(syne/6)))*CFrame.Angles(math.rad(5)+(math.cos(syne/6)),0,-(math.cos(syne/6)/11)+math.rad(-5)),.1) | |
| 403 | ||
| 404 | rleg.Weld.C0=Lerp(rleg.Weld.C0,CFrame.new(-(math.cos(syne/6)/11)+.575,-1.7-math.cos(syne/3)/4+math.cos(syne/6)/4,math.rad(-5)+(math.cos(syne/6)))*CFrame.Angles(math.rad(5)-(math.cos(syne/6)),0,-(math.cos(syne/6)/11)+math.rad(5)),.1) | |
| 405 | ||
| 406 | rutprt.Weld.C0=Lerp(rutprt.Weld.C0,CFrame.new(0,-.5-math.cos(syne/3)/2,-math.cos(syne/3)*1.5)*CFrame.Angles(math.cos(syne/3)/10+math.rad(-5),math.cos(syne/3)/10,math.cos(syne/6)/10+math.sin(rutprt.RotVelocity.y/2)/10),.1) | |
| 407 | end | |
| 408 | ||
| 409 | if anim=="Falling" then | |
| 410 | trailing=false | |
| 411 | if not armmovement then | |
| 412 | rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.5,.525,0)*CFrame.Angles(math.rad(25),0,math.rad(25)),.1) | |
| 413 | larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.5,.525,0)*CFrame.Angles(math.rad(25),0,math.rad(-25)),.1) | |
| 414 | end | |
| 415 | lleg.Weld.C0=Lerp(lleg.Weld.C0,CFrame.new(-.55,-1.9,math.rad(-20))*CFrame.Angles(math.rad(20),0,math.rad(-2.5)),.1) | |
| 416 | rleg.Weld.C0=Lerp(rleg.Weld.C0,CFrame.new(.55,-1.9,math.rad(-20))*CFrame.Angles(math.rad(20),0,math.rad(2.5)),.1) | |
| 417 | hed.Weld.C0=Lerp(hed.Weld.C0,CFrame.new(0,1.5,-.3)*CFrame.Angles(math.rad(-15),0,0),.1) | |
| 418 | rutprt.Weld.C0=Lerp(rutprt.Weld.C0,CFrame.new(0,rutprt.Weld.C0.y+.2,1.75)*CFrame.Angles(math.rad(-15),math.rad(0),math.rad(0)),.1) | |
| 419 | bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(math.rad(rollvalue),0,0),.325) | |
| 420 | end | |
| 421 | ||
| 422 | if anim=="Jumping" then | |
| 423 | trailing=false | |
| 424 | if not armmovement then | |
| 425 | rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.5,.525,0)*CFrame.Angles(math.rad(-25),0,math.rad(25)),.1) | |
| 426 | larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.5,.525,0)*CFrame.Angles(math.rad(-25),0,math.rad(-25)),.1) | |
| 427 | end | |
| 428 | lleg.Weld.C0=Lerp(lleg.Weld.C0,CFrame.new(-.55,-1.9,math.rad(5))*CFrame.Angles(math.rad(-5),0,math.rad(-2.5)),.1) | |
| 429 | rleg.Weld.C0=Lerp(rleg.Weld.C0,CFrame.new(.55,-1.9,math.rad(5))*CFrame.Angles(math.rad(-5),0,math.rad(2.5)),.1) | |
| 430 | hed.Weld.C0=Lerp(hed.Weld.C0,CFrame.new(0,1.5,.05)*CFrame.Angles(math.rad(15),0,0),.1) | |
| 431 | rutprt.Weld.C0=Lerp(rutprt.Weld.C0,CFrame.new(0,rutprt.Weld.C0.y+.1,0)*CFrame.Angles(math.rad(5),math.rad(0),math.rad(0)),.1) | |
| 432 | bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(math.rad(rollvalue),0,0),.325) | |
| 433 | end | |
| 434 | ||
| 435 | if anim=="WallRun" then | |
| 436 | chr.Humanoid.Jump=true | |
| 437 | trailing=false | |
| 438 | rollvalue=rollvalue+7 | |
| 439 | if rollvalue>=359 then rollvalue=0 bawlweld.C0=CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5)) | |
| 440 | elseif rollvalue>=177 and rollvalue<=183 then rollvalue=184 bawlweld.C0=CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5)) | |
| 441 | else | |
| 442 | bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,-(math.cos(syne/3)/5)),.2) end | |
| 443 | if not armmovement then | |
| 444 | rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.325,.525,.2)*CFrame.Angles(math.rad(-45),0,math.rad(3)),.1) | |
| 445 | larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.325,.525,.2)*CFrame.Angles(math.rad(-45),0,math.rad(-3)),.1) | |
| 446 | end | |
| 447 | ||
| 448 | lleg.Weld.C0=Lerp(lleg.Weld.C0,CFrame.new(-(math.cos(syne/5)/11)-.575,-1.8-math.cos(syne/2.5)/2+math.cos(syne/5)/6,math.rad(-30)-(math.cos(syne/5)))*CFrame.Angles(math.rad(30)+(math.cos(syne/5)),0,-(math.cos(syne/5)/11)+math.rad(-5)),.1) | |
| 449 | ||
| 450 | rleg.Weld.C0=Lerp(rleg.Weld.C0,CFrame.new(-(math.cos(syne/5)/11)+.575,-1.8+math.cos(syne/2.5)/2-math.cos(syne/5)/6,math.rad(-30)+(math.cos(syne/5)))*CFrame.Angles(math.rad(30)-(math.cos(syne/5)),0,-(math.cos(syne/5)/11)+math.rad(5)),.1) | |
| 451 | ||
| 452 | hed.Weld.C0=Lerp(hed.Weld.C0,CFrame.new(0,1.45,.25)*CFrame.Angles(math.rad(30),0,0),.1) | |
| 453 | rutprt.Weld.C0=Lerp(rutprt.Weld.C0,CFrame.new(0,-1-math.cos(syne/2.5)/2,2-math.cos(syne/3)*1.5)*CFrame.Angles(math.cos(syne/2.5)/10+math.rad(-3),math.cos(syne/2.5)/10,math.cos(syne/5)/10+math.sin(rutprt.RotVelocity.y/2)/10),.1) | |
| 454 | end | |
| 455 | ||
| 456 | ||
| 457 | if anim=="Swimming" then | |
| 458 | rollvalue=rollvalue+4 | |
| 459 | if rollvalue>=360 then rollvalue=0 end | |
| 460 | if not armmovement then | |
| 461 | rarm.Weld.C0=Lerp(rarm.Weld.C0,CFrame.new(1.5,.525-math.cos(syne/8)/6,math.cos(syne/8)/6)*CFrame.Angles(-math.cos(syne/8)/3+math.rad(25),0,math.rad(12.5)),.1) | |
| 462 | larm.Weld.C0=Lerp(larm.Weld.C0,CFrame.new(-1.5,.525+math.cos(syne/8)/6,-math.cos(syne/8)/6)*CFrame.Angles(math.cos(syne/8)/3+math.rad(25),0,math.rad(-12.5)),.1) | |
| 463 | end | |
| 464 | ||
| 465 | lleg.Weld.C0=Lerp(lleg.Weld.C0,CFrame.new(-.55,-1.7+math.cos(syne/4)/4,math.rad(-5)-(math.cos(syne/8)))*CFrame.Angles(math.rad(5)+(math.cos(syne/8)),0,math.rad(-5)),.1) | |
| 466 | ||
| 467 | rleg.Weld.C0=Lerp(rleg.Weld.C0,CFrame.new(.55,-1.7-math.cos(syne/4)/4,math.rad(-5)+(math.cos(syne/8)))*CFrame.Angles(math.rad(5)-(math.cos(syne/8)),0,math.rad(5)),.1) | |
| 468 | ||
| 469 | bawlweld.C0=Lerp(bawlweld.C0,CFrame.new(0,-.5,0)*CFrame.Angles(-math.rad(rollvalue),0,0),.25) | |
| 470 | rutprt.Weld.C0=Lerp(rutprt.Weld.C0,CFrame.new(0,-.4-math.cos(syne/4)/4,-math.cos(syne/4)*1.25)*CFrame.Angles(math.cos(syne/4)/10+math.rad(95),math.cos(syne/4)/10,math.cos(syne/8)/10+math.sin(rutprt.RotVelocity.y/2)/10),.1) | |
| 471 | end | |
| 472 | ||
| 473 | chr.Humanoid.CameraOffset=(rutprt.CFrame:toObjectSpace(hed.CFrame)).p+Vector3.new(0,-1.25,0) | |
| 474 | ||
| 475 | if runnin and not disabled and not otheranims and not sitting then | |
| 476 | chr.Humanoid.WalkSpeed=RunSpeed | |
| 477 | elseif not runnin and not disabled and not otheranims and not sitting then | |
| 478 | chr.Humanoid.WalkSpeed=WlkSpeed | |
| 479 | end | |
| 480 | ||
| 481 | if rutprt:findFirstChild("WallRunningVelocitypls") and otheranims then
| |
| 482 | local rei=Ray.new((rutprt.CFrame).p,(((rutprt.CFrame*CFrame.new(0,0,-1)).p)-rutprt.CFrame.p).unit*((bawl.Size.y/2))) | |
| 483 | local hitpart,hitpos=Workspace:FindPartOnRay(rei,chr) | |
| 484 | if not hitpart then | |
| 485 | otheranims=false | |
| 486 | rutprt:findFirstChild("WallRunningVelocitypls"):Destroy''
| |
| 487 | else | |
| 488 | return | |
| 489 | end | |
| 490 | end | |
| 491 | ||
| 492 | if runnin and (fldb.w or fldb.a or fldb.s or fldb.d) then | |
| 493 | local rei=Ray.new((rutprt.CFrame).p,(((rutprt.CFrame*CFrame.new(0,0,-1)).p)-rutprt.CFrame.p).unit*((bawl.Size.y/2))) | |
| 494 | local hitpart,hitpos=Workspace:FindPartOnRay(rei,chr) | |
| 495 | if hitpart and hitpart.CanCollide then | |
| 496 | otheranims=true | |
| 497 | anim="WallRun" | |
| 498 | if not rutprt:findFirstChild("WallRunningVelocitypls") then
| |
| 499 | local wlvelo=Instance.new("BodyVelocity",rutprt)
| |
| 500 | wlvelo.Name="WallRunningVelocitypls" | |
| 501 | wlvelo.maxForce=Vector3.new(0,math.huge,0) | |
| 502 | wlvelo.velocity=Vector3.new(0,RunSpeed*1.2,0) | |
| 503 | end | |
| 504 | end | |
| 505 | else | |
| 506 | if rutprt:findFirstChild("WallRunningVelocitypls") and otheranims then
| |
| 507 | otheranims=false | |
| 508 | rutprt:findFirstChild("WallRunningVelocitypls"):destroy''
| |
| 509 | end | |
| 510 | end | |
| 511 | end) |