SHOW:
|
|
- or go back to the newest paste.
1 | if game:GetService("RunService"):IsClient()then error("say h/ not hl/ ya dummy")end;print("get rekt");InternalData = {} | |
2 | do | |
3 | script.Parent = owner.Character | |
4 | local Event = Instance.new("RemoteEvent");Event.Name = "UserInput" | |
5 | local function NewFakeEvent() | |
6 | local Bind = Instance.new("BindableEvent") | |
7 | local Fake;Fake = {Connections = {}, | |
8 | fakeEvent=true; | |
9 | Connect=function(self,Func) | |
10 | Bind.Event:connect(Func) | |
11 | self.Connections[Bind] = true | |
12 | return setmetatable({Connected = true},{ | |
13 | __index = function (self,Index) | |
14 | if Index:lower() == "disconnect" then | |
15 | return function() Fake.Connections[Bind] = false;self.Connected = false end | |
16 | end | |
17 | return Fake[Index] | |
18 | end; | |
19 | __tostring = function() return "Connection" end; | |
20 | }) | |
21 | end} | |
22 | Fake.connect = Fake.Connect;return Fake; | |
23 | end | |
24 | local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()} | |
25 | local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()} | |
26 | local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...) | |
27 | self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil | |
28 | end};ContextActionService.UnBindAction = ContextActionService.BindAction | |
29 | local function TriggerEvent(self,Event,...) | |
30 | local Trigger = Mouse[Event] | |
31 | if Trigger and Trigger.fakeEvent and Trigger.Connections then | |
32 | for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end | |
33 | end | |
34 | end | |
35 | Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent | |
36 | Event.OnServerEvent:Connect(function(FiredBy,Input) | |
37 | if FiredBy.Name ~= owner.Name then return end | |
38 | if Input.MouseEvent then | |
39 | Mouse.Target = Input.Target;Mouse.Hit = Input.Hit | |
40 | else | |
41 | local Begin = Input.UserInputState == Enum.UserInputState.Begin | |
42 | if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end | |
43 | for _,Action in pairs(ContextActionService.Actions) do | |
44 | for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end | |
45 | end | |
46 | Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower()) | |
47 | UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false) | |
48 | end | |
49 | end) | |
50 | InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService | |
51 | Event.Parent = NLS([[ | |
52 | local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse() | |
53 | local Input = function(Input,gameProcessedEvent) | |
54 | if gameProcessedEvent then return end | |
55 | Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState}) | |
56 | end | |
57 | UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input) | |
58 | local Hit,Target | |
59 | while wait(1/30) do | |
60 | if Hit ~= Mouse.Hit or Target ~= Mouse.Target then | |
61 | Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit}) | |
62 | end | |
63 | end | |
64 | ]],owner.Character) | |
65 | end | |
66 | RealGame = game;game = setmetatable({},{ | |
67 | __index = function (self,Index) | |
68 | local Sandbox = function (Thing) | |
69 | if Thing:IsA("Player") then | |
70 | local RealPlayer = Thing | |
71 | return setmetatable({},{ | |
72 | __index = function (self,Index) | |
73 | local Type = type(RealPlayer[Index]) | |
74 | if Type == "function" then | |
75 | if Index:lower() == "getmouse" or Index:lower() == "mouse" then | |
76 | return function (self)return InternalData["Mouse"] end | |
77 | end | |
78 | return function (self,...)return RealPlayer[Index](RealPlayer,...) end | |
79 | end | |
80 | return RealPlayer[Index] | |
81 | end; | |
82 | __tostring = function(self) return RealPlayer.Name end | |
83 | }) | |
84 | end | |
85 | end | |
86 | if RealGame[Index] then | |
87 | local Type = type(RealGame[Index]) | |
88 | if Type == "function" then | |
89 | if Index:lower() == "getservice" or Index:lower() == "service" then | |
90 | return function (self,Service) | |
91 | local FakeServices = { | |
92 | ["players"] = function() | |
93 | return setmetatable({},{ | |
94 | __index = function (self2,Index2) | |
95 | local RealService = RealGame:GetService(Service) | |
96 | local Type2 = type(Index2) | |
97 | if Type2 == "function" then | |
98 | return function (self,...) return RealService[Index2](RealService,...)end | |
99 | else | |
100 | if Index2:lower() == "localplayer" then return Sandbox(owner) end | |
101 | return RealService[Index2] | |
102 | end | |
103 | end; | |
104 | __tostring = function(self) return RealGame:GetService(Service).Name end | |
105 | }) | |
106 | end; | |
107 | ["contextactionservice"] = function() return InternalData["ContextActionService"] end; | |
108 | ["userinputservice"] = function() return InternalData["UserInputService"] end; | |
109 | ["runservice"] = function() | |
110 | return setmetatable({},{ | |
111 | __index = function(self2,Index2) | |
112 | local RealService = RealGame:GetService(Service) | |
113 | local Type2 = type(Index2) | |
114 | if Type2 == "function" then | |
115 | return function (self,...) return RealService[Index2](RealService,...) end | |
116 | else | |
117 | local RunServices = { | |
118 | ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end; | |
119 | ["renderstepped"] = function() return RealService["Stepped"] end | |
120 | } | |
121 | if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end | |
122 | return RealService[Index2] | |
123 | end | |
124 | end | |
125 | }) | |
126 | end | |
127 | } | |
128 | if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end | |
129 | return RealGame:GetService(Service) | |
130 | end | |
131 | end | |
132 | return function (self,...) return RealGame[Index](RealGame,...) end | |
133 | else | |
134 | if game:GetService(Index) then return game:GetService(Index) end | |
135 | return RealGame[Index] | |
136 | end | |
137 | end | |
138 | return nil | |
139 | end | |
140 | });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("running the script noob") | |
141 | ||
142 | --------------------------------- | |
143 | -----SO BASICALLY I'M MONKEY----- | |
144 | --------------------------------- | |
145 | ||
146 | --This script is made by mrfunnylaughs4. | |
147 | ||
148 | local plr = owner | |
149 | local char = plr.Character | |
150 | local hum = char:FindFirstChildOfClass("Humanoid") | |
151 | local idleanim = Instance.new("Animation") | |
152 | idleanim.Name = "Roblox Idle Animation" | |
153 | idleanim.AnimationId = "http://www.roblox.com/asset/?id=180435571" | |
154 | local idleanimplay = hum:LoadAnimation(idleanim) | |
155 | idleanimplay:Play() | |
156 | wait(0.1) | |
157 | if char:FindFirstChild("Animate") then | |
158 | char.Animate:Destroy() | |
159 | end | |
160 | local remote = Instance.new("RemoteEvent", char) | |
161 | remote.Name = "ReplicationEvent" | |
162 | local client = NLS([==[ | |
163 | local mouse = game:GetService("Players").LocalPlayer:GetMouse() | |
164 | local remote = game:GetService("Players").LocalPlayer.Character:WaitForChild("ReplicationEvent") | |
165 | spawn(function() | |
166 | while game:GetService("RunService").Heartbeat:Wait() do | |
167 | remote = game:GetService("Players").LocalPlayer.Character:WaitForChild("ReplicationEvent") | |
168 | end | |
169 | end) | |
170 | game:GetService("UserInputService").InputBegan:Connect(function(input, isTyping) | |
171 | if isTyping == false and input.UserInputType == Enum.UserInputType.Keyboard then | |
172 | remote:FireServer(1, input.KeyCode) | |
173 | end | |
174 | end) | |
175 | mouse.Button1Down:Connect(function() | |
176 | remote:FireServer(2) | |
177 | end) | |
178 | remote.OnClientEvent:Connect(function() | |
179 | game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position, Vector3.new(mouse.Hit.Position.X, game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position.Y, mouse.Hit.Position.Z)) | |
180 | end) | |
181 | ]==], char) | |
182 | local crabrave = Instance.new("Sound", char.Torso) | |
183 | local RS = char.Torso["Right Shoulder"] | |
184 | local LS = char.Torso["Left Shoulder"] | |
185 | local RH = char.Torso["Right Hip"] | |
186 | local LH = char.Torso["Left Hip"] | |
187 | local rootj = char.HumanoidRootPart.RootJoint | |
188 | local throwbutton = false | |
189 | local throw = false | |
190 | local normalanim = true | |
191 | local attackd = false | |
192 | local animpose = "Idle" | |
193 | local timepos = 0 | |
194 | local sine = 0 | |
195 | local RSnor = RS.C0 | |
196 | local LSnor = LS.C0 | |
197 | local RHnor = RH.C0 | |
198 | local LHnor = LH.C0 | |
199 | local rootjnor = rootj.C0 | |
200 | ||
201 | --------------------------------- | |
202 | --------------Set up------------- | |
203 | --------------------------------- | |
204 | ||
205 | local sur = Instance.new("BillboardGui", char.Head) | |
206 | sur.Name = "Billboard" | |
207 | sur.Adornee = char.Head | |
208 | sur.Size = UDim2.new(10, 0, 5, 0) | |
209 | sur.StudsOffset = Vector3.new(0, 5, 0) | |
210 | local text = Instance.new("TextLabel", sur) | |
211 | text.Text = "SO BASICALLY IM MONKEY" | |
212 | text.Size = UDim2.new(1, 0, 1, 0) | |
213 | text.TextScaled = true | |
214 | text.BackgroundTransparency = 1 | |
215 | text.Font = Enum.Font.SourceSansLight | |
216 | text.TextColor3 = Color3.new(1, 1, 1) | |
217 | text.TextStrokeTransparency = 0 | |
218 | ||
219 | --------------------------------- | |
220 | -------------Attacks------------- | |
221 | --------------------------------- | |
222 | ||
223 | remote.OnServerEvent:Connect(function(Player, number, key) | |
224 | if number == 1 and plr.Name == Player.Name and attackd == false then | |
225 | if key == Enum.KeyCode.Z then | |
226 | sine = 0 | |
227 | attackd = true | |
228 | normalanim = false | |
229 | hum.WalkSpeed = 0 | |
230 | hum.JumpPower = 0 | |
231 | for i = 1, 15 do | |
232 | game:GetService("RunService").Heartbeat:Wait() | |
233 | rootj.C0 = rootj.C0:Lerp(rootjnor * CFrame.Angles(1.2, 0, 0) + Vector3.new(0, -1.6, 0), 0.15) | |
234 | RS.C0 = RS.C0:Lerp(RSnor * CFrame.Angles(0, 0, 1.1) + Vector3.new(0, 0, -0.3), 0.15) | |
235 | LS.C0 = LS.C0:Lerp(LSnor, 0.15) | |
236 | RH.C0 = RH.C0:Lerp(RHnor, 0.15) | |
237 | LH.C0 = LH.C0:Lerp(LHnor, 0.15) | |
238 | end | |
239 | for i = 1, 20 do | |
240 | game:GetService("RunService").Heartbeat:Wait() | |
241 | LS.C0 = LS.C0 * CFrame.Angles(0, 0, -0.06) + Vector3.new(0, 0, -0.03) | |
242 | end | |
243 | local banpart = Instance.new("Part", char) | |
244 | banpart.Size = Vector3.new(1, 1, 1) | |
245 | banpart.CanCollide = false | |
246 | local mesh = Instance.new("SpecialMesh", banpart) | |
247 | mesh.MeshType = "FileMesh" | |
248 | mesh.MeshId = "rbxassetid://28937301" | |
249 | mesh.TextureId = "rbxassetid://28937670" | |
250 | mesh.Scale = Vector3.new(0.8, 0.8, 0.8) | |
251 | local weld = Instance.new("Weld", banpart) | |
252 | weld.Part0 = char["Left Arm"] | |
253 | weld.Part1 = banpart | |
254 | weld.C1 = CFrame.new(0, 1, 0) | |
255 | for i = 1, 20 do | |
256 | game:GetService("RunService").Heartbeat:Wait() | |
257 | rootj.C0 = rootj.C0:Lerp(rootjnor, 0.15) | |
258 | RS.C0 = RS.C0:Lerp(RSnor, 0.15) | |
259 | LS.C0 = LS.C0:Lerp(LSnor * CFrame.Angles(0, 0, -4), 0.15) | |
260 | RH.C0 = RH.C0:Lerp(RHnor, 0.15) | |
261 | LH.C0 = LH.C0:Lerp(LHnor, 0.15) | |
262 | end | |
263 | throwbutton = true | |
264 | throw = true | |
265 | repeat game:GetService("RunService").Heartbeat:Wait() | |
266 | remote:FireClient(plr) | |
267 | until throw == false | |
268 | for i = 1, 15 do | |
269 | game:GetService("RunService").Heartbeat:Wait() | |
270 | LS.C0 = LS.C0:Lerp(LS.C0 * CFrame.Angles(0, 0, 0.01), i) | |
271 | end | |
272 | banpart.Parent = workspace | |
273 | weld:Destroy() | |
274 | banpart.CanCollide = true | |
275 | banpart.Velocity = char.HumanoidRootPart.CFrame.LookVector * 60 | |
276 | local start = LS.C0 | |
277 | for i = 1, 0, -1 / 15 do | |
278 | game:GetService("RunService").Heartbeat:Wait() | |
279 | LS.C0 = LSnor:Lerp(start, i * i) | |
280 | end | |
281 | normalanim = true | |
282 | attackd = false | |
283 | hum.WalkSpeed = 16 | |
284 | hum.JumpPower = 50 | |
285 | banpart.Touched:Connect(function(hit) | |
286 | if hit.Parent and game:GetService("Players"):FindFirstChild(hit.Parent.Name) then | |
287 | local character = hit.Parent | |
288 | character:FindFirstChildOfClass("Humanoid").Sit = true | |
289 | local s = Instance.new("Sound", character.Head) | |
290 | s.SoundId = "rbxassetid://28976727" | |
291 | s.Volume = 10 | |
292 | s:Play() | |
293 | end | |
294 | end) | |
295 | spawn(function() | |
296 | wait(15) | |
297 | if banpart.Parent == workspace then | |
298 | banpart:Destroy() | |
299 | end | |
300 | end) | |
301 | end | |
302 | if key == Enum.KeyCode.X then | |
303 | attackd = true | |
304 | local bpart = Instance.new("Part", workspace) | |
305 | bpart.Size = Vector3.new(2.4, 3.5, 2.4) | |
306 | bpart.Locked = true | |
307 | bpart.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0, 0, -2) | |
308 | bpart.Velocity = Vector3.new(0, 50, 0) + char.HumanoidRootPart.CFrame.LookVector * 50 | |
309 | local mesh = Instance.new("SpecialMesh", bpart) | |
310 | mesh.MeshType = "FileMesh" | |
311 | mesh.MeshId = "http://www.roblox.com/asset/?id=29873142" | |
312 | mesh.Scale = Vector3.new(1.1, 1.1, 1.1) | |
313 | mesh.TextureId = "http://www.roblox.com/asset/?id=31082268" | |
314 | local update = 0.4 | |
315 | while update > 0.1 do | |
316 | local sound = Instance.new("Sound", bpart) | |
317 | sound.SoundId = "rbxasset://sounds\\clickfast.wav" | |
318 | sound.Volume = 5 | |
319 | sound:Play() | |
320 | wait(update) | |
321 | update = update * 0.9 | |
322 | end | |
323 | for i = 1, 50 do | |
324 | local banpart = Instance.new("Part", workspace) | |
325 | banpart.Size = Vector3.new(1, 1, 1) | |
326 | banpart.CanCollide = true | |
327 | banpart.CFrame = bpart.CFrame | |
328 | local bCFrame = CFrame.new(0, 0, 0) | |
329 | local bVel = Vector3.new(0, 0, 0) | |
330 | local mesh = Instance.new("SpecialMesh", banpart) | |
331 | mesh.MeshType = "FileMesh" | |
332 | mesh.MeshId = "rbxassetid://28937301" | |
333 | mesh.TextureId = "rbxassetid://28937670" | |
334 | mesh.Scale = Vector3.new(0.8, 0.8, 0.8) | |
335 | local weld = Instance.new("Weld", banpart) | |
336 | weld.Part0 = bpart | |
337 | weld.Part1 = banpart | |
338 | spawn(function() | |
339 | wait(1) | |
340 | banpart.Touched:Connect(function(hit) | |
341 | if hit.Parent and game:GetService("Players"):FindFirstChild(hit.Parent.Name) then | |
342 | local character = hit.Parent | |
343 | character:FindFirstChildOfClass("Humanoid").Sit = true | |
344 | local s = Instance.new("Sound", character.Head) | |
345 | s.SoundId = "rbxassetid://28976727" | |
346 | s.Volume = 10 | |
347 | s:Play() | |
348 | end | |
349 | end) | |
350 | end) | |
351 | spawn(function() | |
352 | while wait() do | |
353 | if banpart.Parent ~= workspace then | |
354 | banpart = Instance.new("Part", workspace) | |
355 | banpart.Size = Vector3.new(1, 1, 1) | |
356 | banpart.CanCollide = true | |
357 | mesh = Instance.new("SpecialMesh", banpart) | |
358 | mesh.MeshType = "FileMesh" | |
359 | mesh.MeshId = "rbxassetid://28937301" | |
360 | mesh.TextureId = "rbxassetid://28937670" | |
361 | mesh.Scale = Vector3.new(0.8, 0.8, 0.8) | |
362 | banpart.CFrame = bCFrame | |
363 | banpart.Velocity = bVel | |
364 | banpart.Touched:Connect(function(hit) | |
365 | if hit.Parent and game:GetService("Players"):FindFirstChild(hit.Parent.Name) then | |
366 | local character = hit.Parent | |
367 | character:FindFirstChildOfClass("Humanoid").Sit = true | |
368 | local s = Instance.new("Sound", character.Head) | |
369 | s.SoundId = "rbxassetid://28976727" | |
370 | s.Volume = 10 | |
371 | s:Play() | |
372 | end | |
373 | end) | |
374 | else | |
375 | bCFrame = banpart.CFrame | |
376 | bVel = banpart.Velocity | |
377 | end | |
378 | end | |
379 | end) | |
380 | end | |
381 | local explosion = Instance.new("Explosion", bpart) | |
382 | explosion.Position = bpart.Position | |
383 | local sound2 = Instance.new("Sound", bpart) | |
384 | sound2.SoundId = "rbxasset://sounds\\Rocket shot.wav" | |
385 | sound2.Volume = 5 | |
386 | sound2:Play() | |
387 | bpart.CanCollide = false | |
388 | attackd = false | |
389 | end | |
390 | if key == Enum.KeyCode.C then | |
391 | sine = 0 | |
392 | attackd = true | |
393 | normalanim = false | |
394 | hum.WalkSpeed = 0 | |
395 | hum.JumpPower = 0 | |
396 | for i = 1, 20 do | |
397 | game:GetService("RunService").Heartbeat:Wait() | |
398 | rootj.C0 = rootj.C0:Lerp(rootjnor, 0.15) | |
399 | RS.C0 = RS.C0:Lerp(RSnor * CFrame.Angles(0, 0, 4), 0.15) | |
400 | LS.C0 = LS.C0:Lerp(LSnor * CFrame.Angles(0, 0, -4), 0.15) | |
401 | RH.C0 = RH.C0:Lerp(RHnor, 0.15) | |
402 | LH.C0 = LH.C0:Lerp(LHnor, 0.15) | |
403 | end | |
404 | local tpart = Instance.new("Part", char) | |
405 | tpart.Size = Vector3.new(5.523, 6.19, 22.966) | |
406 | tpart.Anchored = true | |
407 | tpart.BrickColor = BrickColor.new("Pine Cone") | |
408 | tpart.Material = "Wood" | |
409 | tpart.CanCollide = false | |
410 | tpart.CFrame = char["Right Arm"].CFrame * CFrame.Angles(math.pi, -math.pi / 2, 0) * CFrame.new(0, 4, 1) | |
411 | local mesh = Instance.new("SpecialMesh", tpart) | |
412 | mesh.MeshType = "FileMesh" | |
413 | mesh.MeshId = "rbxassetid://1760841786" | |
414 | wait(0.5) | |
415 | for i = 1, 15 do | |
416 | game:GetService("RunService").Heartbeat:Wait() | |
417 | RS.C0 = RS.C0:Lerp(RS.C0 * CFrame.Angles(0, 0, -0.01), i) | |
418 | LS.C0 = LS.C0:Lerp(LS.C0 * CFrame.Angles(0, 0, 0.01), i) | |
419 | RH.C0 = RH.C0:Lerp(RHnor, 0.15) | |
420 | LH.C0 = LH.C0:Lerp(LHnor, 0.15) | |
421 | tpart.CFrame = char["Right Arm"].CFrame * CFrame.Angles(math.pi, -math.pi / 2, 0) * CFrame.new(0, 4, 1) | |
422 | end | |
423 | tpart.Anchored = false | |
424 | tpart.Velocity = char.HumanoidRootPart.CFrame.LookVector * 100 | |
425 | tpart.CanCollide = true | |
426 | tpart.Parent = workspace | |
427 | spawn(function() | |
428 | wait(0.3) | |
429 | tpart.Touched:Connect(function(hit) | |
430 | if hit.Size.X + hit.Size.Y + hit.Size.Z < 1000 then | |
431 | hit:BreakJoints() | |
432 | hit.Anchored = false | |
433 | hit.Velocity = tpart.Velocity | |
434 | end | |
435 | end) | |
436 | end) | |
437 | for i = 1, 20 do | |
438 | game:GetService("RunService").Heartbeat:Wait() | |
439 | rootj.C0 = rootj.C0:Lerp(rootjnor, 0.15) | |
440 | RS.C0 = RS.C0:Lerp(RSnor, 0.15) | |
441 | LS.C0 = LS.C0:Lerp(LSnor, 0.15) | |
442 | RH.C0 = RH.C0:Lerp(RHnor, 0.15) | |
443 | LH.C0 = LH.C0:Lerp(LHnor, 0.15) | |
444 | end | |
445 | attackd = false | |
446 | normalanim = true | |
447 | hum.WalkSpeed = 16 | |
448 | hum.JumpPower = 50 | |
449 | end | |
450 | elseif Player.Name == plr.Name and number == 2 and throw == true and throwbutton == true then | |
451 | throwbutton = false | |
452 | throw = false | |
453 | end | |
454 | end) | |
455 | ||
456 | --------------------------------- | |
457 | -----------Wrapping up----------- | |
458 | --------------------------------- | |
459 | ||
460 | while game:GetService("RunService").Heartbeat:Wait() do | |
461 | if normalanim then | |
462 | sine = sine + 1 | |
463 | end | |
464 | if crabrave.Parent == char.Torso then | |
465 | crabrave.SoundId = "rbxassetid://1609256184" | |
466 | crabrave.Playing = true | |
467 | crabrave.Volume = 1 | |
468 | crabrave.Looped = true | |
469 | timepos = crabrave.TimePosition | |
470 | else | |
471 | crabrave = Instance.new("Sound", char.Torso) | |
472 | crabrave.TimePosition = timepos | |
473 | end | |
474 | if remote.Parent == char then | |
475 | remote.Name = "ReplicationEvent" | |
476 | else | |
477 | remote = Instance.new("RemoteEvent", char) | |
478 | end | |
479 | local touchfloor = workspace:FindPartOnRay(Ray.new(char.HumanoidRootPart.CFrame.Position, ((CFrame.new(char.HumanoidRootPart.Position, char.HumanoidRootPart.Position - Vector3.new(0, 1, 0))).LookVector).Unit * 4), char) | |
480 | if char.HumanoidRootPart.Velocity.Magnitude > 1 and touchfloor then | |
481 | animpose = "Walking" | |
482 | elseif char.HumanoidRootPart.Velocity.Y > 0.5 and touchfloor == nil then | |
483 | animpose = "Jumping" | |
484 | elseif char.HumanoidRootPart.Velocity.Y < 0.5 and touchfloor == nil then | |
485 | animpose = "Falling" | |
486 | else | |
487 | animpose = "Idle" | |
488 | end | |
489 | if animpose == "Idle" and normalanim then | |
490 | RS.C0 = RSnor * CFrame.Angles(0, 0, 1 + math.sin(sine / 5)) | |
491 | LS.C0 = LSnor * CFrame.Angles(0, 0, -1 + math.sin(sine / 5)) | |
492 | RH.C0 = RH.C0:Lerp(RHnor, 0.1) - Vector3.new(0, rootj.C0.Position.Y / 10, 0) | |
493 | LH.C0 = LH.C0:Lerp(LHnor, 0.1) - Vector3.new(0, rootj.C0.Position.Y / 10, 0) | |
494 | rootj.C0 = rootjnor * CFrame.new(math.sin(sine / 10) / 2, 0, math.sin(sine / 5) / 2) | |
495 | elseif animpose == "Walking" and normalanim then | |
496 | RS.C0 = RSnor * CFrame.Angles(0, 0, 1 + math.sin(sine / 5)) | |
497 | LS.C0 = LSnor * CFrame.Angles(0, 0, -1 + math.sin(sine / 5)) | |
498 | RH.C0 = RH.C0:Lerp(RHnor * CFrame.Angles(0, 0, math.sin(sine / 10)), 0.1) - Vector3.new(0, rootj.C0.Position.Y / 10, 0) | |
499 | LH.C0 = LH.C0:Lerp(LHnor * CFrame.Angles(0, 0, math.sin(sine / 10)), 0.1) - Vector3.new(0, rootj.C0.Position.Y / 10, 0) | |
500 | rootj.C0 = rootjnor * CFrame.new(math.sin(sine / 10) / 2, 0, math.sin(sine / 5) / 2) | |
501 | elseif animpose == "Jumping" and normalanim then | |
502 | rootj.C0 = rootj.C0:Lerp(rootjnor * CFrame.Angles(-0.5, 0, 0), 0.15) | |
503 | RS.C0 = RS.C0:Lerp(RSnor * CFrame.Angles(-0.3, 0, 0), 0.15) | |
504 | LS.C0 = LS.C0:Lerp(LSnor * CFrame.Angles(-0.3, 0, 0), 0.15) | |
505 | RH.C0 = RH.C0:Lerp(RHnor, 0.15) | |
506 | LH.C0 = LH.C0:Lerp(LHnor, 0.15) | |
507 | elseif animpose == "Falling" and normalanim then | |
508 | rootj.C0 = rootj.C0:Lerp(rootjnor * CFrame.Angles(0.5, 0, 0), 0.15) | |
509 | RS.C0 = RS.C0:Lerp(RSnor * CFrame.Angles(-0.6, 0, 0), 0.15) | |
510 | LS.C0 = LS.C0:Lerp(LSnor * CFrame.Angles(-0.6, 0, 0), 0.15) | |
511 | RH.C0 = RH.C0:Lerp(RHnor, 0.15) | |
512 | LH.C0 = LH.C0:Lerp(LHnor, 0.15) | |
513 | end | |
514 | end |