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