SHOW:
|
|
- or go back to the newest paste.
| 1 | -- This script has convert to FE by who i don't know? | |
| 2 | ||
| 3 | ----------------------------------------------------- | |
| 4 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
| |
| 5 | local Player,game,owner = owner,game | |
| 6 | local RealPlayer = Player | |
| 7 | do | |
| 8 | print("FE Compatibility code by Mokiros | Showcase by Bacon Hair!")
| |
| 9 | local rp = RealPlayer | |
| 10 | script.Parent = rp.Character | |
| 11 | ||
| 12 | --RemoteEvent for communicating | |
| 13 | local Event = Instance.new("RemoteEvent")
| |
| 14 | Event.Name = "UserInput_Event" | |
| 15 | ||
| 16 | --Fake event to make stuff like Mouse.KeyDown work | |
| 17 | local function fakeEvent() | |
| 18 | local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
| |
| 19 | t.connect = t.Connect | |
| 20 | return t | |
| 21 | end | |
| 22 | ||
| 23 | --Creating fake input objects with fake variables | |
| 24 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
| |
| 25 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
| |
| 26 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
| |
| 27 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
| |
| 28 | end} | |
| 29 | --Merged 2 functions into one by checking amount of arguments | |
| 30 | CAS.UnbindAction = CAS.BindAction | |
| 31 | ||
| 32 | --This function will trigger the events that have been :Connect()'ed | |
| 33 | local function te(self,ev,...) | |
| 34 | local t = m[ev] | |
| 35 | if t and t._fakeEvent then | |
| 36 | for _,f in pairs(t.Functions) do | |
| 37 | f(...) | |
| 38 | end | |
| 39 | end | |
| 40 | end | |
| 41 | m.TrigEvent = te | |
| 42 | UIS.TrigEvent = te | |
| 43 | ||
| 44 | Event.OnServerEvent:Connect(function(plr,io) | |
| 45 | if plr~=rp then return end | |
| 46 | m.Target = io.Target | |
| 47 | m.Hit = io.Hit | |
| 48 | if not io.isMouse then | |
| 49 | local b = io.UserInputState == Enum.UserInputState.Begin | |
| 50 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
| 51 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
| 52 | end | |
| 53 | for _,t in pairs(CAS.Actions) do | |
| 54 | for _,k in pairs(t.Keys) do | |
| 55 | if k==io.KeyCode then | |
| 56 | t.Function(t.Name,io.UserInputState,io) | |
| 57 | end | |
| 58 | end | |
| 59 | end | |
| 60 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
| 61 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
| 62 | end | |
| 63 | end) | |
| 64 | Event.Parent = NLS([==[ | |
| 65 | local Player = game:GetService("Players").LocalPlayer
| |
| 66 | local Event = script:WaitForChild("UserInput_Event")
| |
| 67 | ||
| 68 | local Mouse = Player:GetMouse() | |
| 69 | local UIS = game:GetService("UserInputService")
| |
| 70 | local input = function(io,a) | |
| 71 | if a then return end | |
| 72 | --Since InputObject is a client-side instance, we create and pass table instead | |
| 73 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
| |
| 74 | end | |
| 75 | UIS.InputBegan:Connect(input) | |
| 76 | UIS.InputEnded:Connect(input) | |
| 77 | ||
| 78 | local h,t | |
| 79 | --Give the server mouse data 30 times every second, but only if the values changed | |
| 80 | --If player is not moving their mouse, client won't fire events | |
| 81 | while wait(1/30) do | |
| 82 | if h~=Mouse.Hit or t~=Mouse.Target then | |
| 83 | h,t=Mouse.Hit,Mouse.Target | |
| 84 | Event:FireServer({isMouse=true,Target=t,Hit=h})
| |
| 85 | end | |
| 86 | end]==],Player.Character) | |
| 87 | ||
| 88 | ----Sandboxed game object that allows the usage of client-side methods and services | |
| 89 | --Real game object | |
| 90 | local _rg = game | |
| 91 | ||
| 92 | --Metatable for fake service | |
| 93 | local fsmt = {
| |
| 94 | __index = function(self,k) | |
| 95 | local s = rawget(self,"_RealService") | |
| 96 | if s then return s[k] end | |
| 97 | end, | |
| 98 | __newindex = function(self,k,v) | |
| 99 | local s = rawget(self,"_RealService") | |
| 100 | if s then s[k]=v end | |
| 101 | end, | |
| 102 | __call = function(self,...) | |
| 103 | local s = rawget(self,"_RealService") | |
| 104 | if s then return s(...) end | |
| 105 | end | |
| 106 | } | |
| 107 | local function FakeService(t,RealService) | |
| 108 | t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService | |
| 109 | return setmetatable(t,fsmt) | |
| 110 | end | |
| 111 | ||
| 112 | --Fake game object | |
| 113 | local g = {
| |
| 114 | GetService = function(self,s) | |
| 115 | return self[s] | |
| 116 | end, | |
| 117 | Players = FakeService({
| |
| 118 | LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
| |
| 119 | },"Players"), | |
| 120 | UserInputService = FakeService(UIS,"UserInputService"), | |
| 121 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
| 122 | } | |
| 123 | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) | |
| 124 | g.service = g.GetService | |
| 125 | ||
| 126 | g.RunService = FakeService({
| |
| 127 | RenderStepped = _rg:GetService("RunService").Heartbeat,
| |
| 128 | BindToRenderStep = function(self,name,_,fun) | |
| 129 | ||
| 130 | end, | |
| 131 | UnbindFromRenderStep = function(self,name) | |
| 132 | self._btrs[name]:Disconnect() | |
| 133 | end, | |
| 134 | },"RunService") | |
| 135 | ||
| 136 | setmetatable(g,{
| |
| 137 | __index=function(self,s) | |
| 138 | return _rg:GetService(s) or typeof(_rg[s])=="function" | |
| 139 | and function(_,...)return _rg[s](_rg,...)end or _rg[s] | |
| 140 | end, | |
| 141 | __newindex = fsmt.__newindex, | |
| 142 | __call = fsmt.__call | |
| 143 | }) | |
| 144 | --Changing owner to fake player object to support owner:GetMouse() | |
| 145 | game,owner = g,g.Players.LocalPlayer | |
| 146 | end | |
| 147 | ------------------------------------------------------------------------ | |
| 148 | -- Made by Cronizete -- | |
| 149 | ------------------------------------------------------------------------ | |
| 150 | ||
| 151 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
| 152 | do | |
| 153 | --print("FE Compatibility code by Mokiros")
| |
| 154 | script.Parent = Player.Character | |
| 155 | ||
| 156 | --RemoteEvent for communicating | |
| 157 | local Event = Instance.new("RemoteEvent")
| |
| 158 | Event.Name = "UserInput_Event" | |
| 159 | ||
| 160 | --Fake event to make stuff like Mouse.KeyDown work | |
| 161 | local function fakeEvent() | |
| 162 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
| |
| 163 | t.connect = t.Connect | |
| 164 | return t | |
| 165 | end | |
| 166 | ||
| 167 | --Creating fake input objects with fake variables | |
| 168 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
| |
| 169 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
| |
| 170 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
| |
| 171 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
| |
| 172 | end} | |
| 173 | --Merged 2 functions into one by checking amount of arguments | |
| 174 | CAS.UnbindAction = CAS.BindAction | |
| 175 | ||
| 176 | --This function will trigger the events that have been :Connect()'ed | |
| 177 | local function te(self,ev,...) | |
| 178 | local t = m[ev] | |
| 179 | if t and t._fakeEvent and t.Function then | |
| 180 | t.Function(...) | |
| 181 | end | |
| 182 | end | |
| 183 | m.TrigEvent = te | |
| 184 | UIS.TrigEvent = te | |
| 185 | ||
| 186 | Event.OnServerEvent:Connect(function(plr,io) | |
| 187 | if plr~=Player then return end | |
| 188 | if io.isMouse then | |
| 189 | m.Target = io.Target | |
| 190 | m.Hit = io.Hit | |
| 191 | else | |
| 192 | local b = io.UserInputState == Enum.UserInputState.Begin | |
| 193 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
| 194 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
| 195 | end | |
| 196 | for _,t in pairs(CAS.Actions) do | |
| 197 | for _,k in pairs(t.Keys) do | |
| 198 | if k==io.KeyCode then | |
| 199 | t.Function(t.Name,io.UserInputState,io) | |
| 200 | end | |
| 201 | end | |
| 202 | end | |
| 203 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
| 204 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
| 205 | end | |
| 206 | end) | |
| 207 | Event.Parent = NLS([==[ | |
| 208 | local Player = game:GetService("Players").LocalPlayer
| |
| 209 | local Event = script:WaitForChild("UserInput_Event")
| |
| 210 | ||
| 211 | local UIS = game:GetService("UserInputService")
| |
| 212 | local input = function(io,a) | |
| 213 | if a then return end | |
| 214 | --Since InputObject is a client-side instance, we create and pass table instead | |
| 215 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
| |
| 216 | end | |
| 217 | UIS.InputBegan:Connect(input) | |
| 218 | UIS.InputEnded:Connect(input) | |
| 219 | ||
| 220 | local Mouse = Player:GetMouse() | |
| 221 | local h,t | |
| 222 | --Give the server mouse data 30 times every second, but only if the values changed | |
| 223 | --If player is not moving their mouse, client won't fire events | |
| 224 | while wait(1/30) do | |
| 225 | if h~=Mouse.Hit or t~=Mouse.Target then | |
| 226 | h,t=Mouse.Hit,Mouse.Target | |
| 227 | Event:FireServer({isMouse=true,Target=t,Hit=h})
| |
| 228 | end | |
| 229 | end]==],Player.Character) | |
| 230 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
| 231 | end | |
| 232 | ||
| 233 | ------------------------------------------------------------------------ | |
| 234 | -- Things -- | |
| 235 | ------------------------------------------------------------------------ | |
| 236 | ||
| 237 | plr = owner | |
| 238 | char = plr.Character | |
| 239 | lleg,rleg,larm,rarm,hed = char["Left Leg"],char["Right Leg"],char["Left Arm"],char["Right Arm"],char["Head"] | |
| 240 | rutprt,torso = char.HumanoidRootPart,char.Torso | |
| 241 | otheranims,swimming,hum,stopanim,cooldown = false,false,char:FindFirstChildOfClass'Humanoid',false,false | |
| 242 | TweenService = game:GetService("TweenService")
| |
| 243 | stopanim2 = false -- larm | |
| 244 | stopanim3 = false -- head | |
| 245 | ||
| 246 | hammer = Instance.new('Part', char)
| |
| 247 | hammer.Name = "Hammer" | |
| 248 | hammer.CanCollide = true | |
| 249 | hammer.Position = char.Head.Position | |
| 250 | hammer.Size = Vector3.new(1.71, 1.31, 3.2) | |
| 251 | hammer.Locked = true | |
| 252 | mesh = Instance.new('SpecialMesh', hammer)
| |
| 253 | mesh.MeshId = "rbxassetid://12592754" | |
| 254 | mesh.TextureId = "rbxassetid://12592745" | |
| 255 | mesh.Scale = Vector3.new(1.05, 1.05, 1.05) | |
| 256 | ||
| 257 | fx = Instance.new('Part', char)
| |
| 258 | fx.Anchored = false | |
| 259 | fx.CanCollide = false | |
| 260 | fx.Transparency = 1 | |
| 261 | fx.Size = Vector3.new(1.77, 0.85, 1.05) | |
| 262 | weld = Instance.new('Weld', fx)
| |
| 263 | weld.Part0 = fx | |
| 264 | weld.Part1 = hammer | |
| 265 | weld.C0 = CFrame.new(0, 0, -1.2) | |
| 266 | ||
| 267 | func = hammer.Touched:connect(function(hit) | |
| 268 | if not hit.Parent:FindFirstChildOfClass'Humanoid' then | |
| 269 | wait(1) | |
| 270 | hammer.Anchored = true | |
| 271 | func:disconnect() | |
| 272 | end | |
| 273 | end) | |
| 274 | ||
| 275 | function gettorso(a) | |
| 276 | return a:FindFirstChild'Torso' or a:FindFirstChild'UpperTorso' or a:FindFirstChild'LowerTorso' or a:FindFirstChild'HumanoidRootPart' | |
| 277 | end | |
| 278 | ||
| 279 | ------------------------------------------------------------------------ | |
| 280 | -- Animate Stuff -- | |
| 281 | ------------------------------------------------------------------------ | |
| 282 | char.Animate.Disabled=true | |
| 283 | local fldb={['w']=false,['a']=false,['s']=false,['d']=false}
| |
| 284 | local RunSpeed=30 | |
| 285 | ||
| 286 | local WlkSpeed=16 | |
| 287 | local SwimSpeed=14 | |
| 288 | local SwimDashSpeed=28 | |
| 289 | local anim = "Idling" | |
| 290 | local lastanim = "Idling" | |
| 291 | local val = 0 | |
| 292 | local syne = 0 | |
| 293 | local num = 0 | |
| 294 | local runtime = 0 | |
| 295 | local pseudohead=hed:Clone() | |
| 296 | for i,x in pairs(pseudohead:GetChildren()) do if not x.ClassName:find('Mesh') then x:Destroy() end end
| |
| 297 | pseudohead.Name='PseudoHead' | |
| 298 | pseudohead.Parent=char.Head | |
| 299 | local pseudoweld=Instance.new('Weld',torso)
| |
| 300 | pseudoweld.Part0=hed | |
| 301 | pseudoweld.Name='PseudoHedWld' | |
| 302 | pseudoweld.Part1=pseudohead | |
| 303 | hed.Transparency=1 | |
| 304 | ||
| 305 | coroutine.wrap(function() for i,x in pairs(hed:GetChildren()) do if x:IsA('Sound') then x:Destroy() end end end)()
| |
| 306 | ||
| 307 | function Lerp(a, b, i) | |
| 308 | local com1 = {a.X, a.Y, a.Z, a:toEulerAnglesXYZ()}
| |
| 309 | local com2 = {b.X, b.Y, b.Z, b:toEulerAnglesXYZ()}
| |
| 310 | local calx = com1[1] + (com2[1] - com1[1]) * i | |
| 311 | local caly = com1[2] + (com2[2] - com1[2]) * i | |
| 312 | local calz = com1[3] + (com2[3] - com1[3]) * i | |
| 313 | local cala = com1[4] + (com2[4] - com1[4]) * i | |
| 314 | local calb = com1[5] + (com2[5] - com1[5]) * i | |
| 315 | local calc = com1[6] + (com2[6] - com1[6]) * i | |
| 316 | return CFrame.new(calx, caly, calz) * CFrame.Angles(cala, calb, calc) | |
| 317 | end | |
| 318 | ||
| 319 | function TwnSingleNumber(s,f,m) | |
| 320 | local wot=s+(f-s)*m | |
| 321 | return wot | |
| 322 | end | |
| 323 | ||
| 324 | function TwnVector3(q,w,e) | |
| 325 | local begin={q.x,q.y,q.z}
| |
| 326 | local ending={w.x,w.y,w.z}
| |
| 327 | local bgx=begin[1]+(ending[1]-begin[1])*e | |
| 328 | local bgy=begin[2]+(ending[2]-begin[2])*e | |
| 329 | local bgz=begin[3]+(ending[3]-begin[3])*e | |
| 330 | return Vector3.new(bgx,bgy,bgz) | |
| 331 | end | |
| 332 | ||
| 333 | newWeld = function(wld, wp0, wp1, wc0x, wc0y, wc0z) | |
| 334 | wld = Instance.new("Weld", wp1)
| |
| 335 | wld.Part0 = wp0 | |
| 336 | wld.Part1 = wp1 | |
| 337 | wld.C0 = CFrame.new(wc0x, wc0y, wc0z) | |
| 338 | end | |
| 339 | ||
| 340 | local angles = CFrame.Angles | |
| 341 | function clerp(a, b, t) | |
| 342 | return a:lerp(b, t) | |
| 343 | end | |
| 344 | ||
| 345 | newWeld(law, torso, larm, -1.5, 0.5, 0) | |
| 346 | newWeld(raw, torso, rarm, 1.5, 0.5, 0) | |
| 347 | newWeld(llw, torso, lleg, -.5, -2, 0) | |
| 348 | newWeld(rlw, torso, rleg, .5, -2, 0) | |
| 349 | newWeld(hw, torso, hed, 0, 1.5, 0) | |
| 350 | local rutwald=Instance.new('Weld',rutprt)
| |
| 351 | rutwald.Part0=rutprt | |
| 352 | rutwald.Part1=torso | |
| 353 | rutprt.Weld.C1=CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),math.rad(0),0) | |
| 354 | larm.Weld.C1 = CFrame.new(0, 0.5, 0)*CFrame.Angles(math.rad(0),0,0) | |
| 355 | rarm.Weld.C1 = CFrame.new(0, 0.5, 0)*CFrame.Angles(math.rad(0),0,0) | |
| 356 | rleg.Weld.C1=CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),0,0) | |
| 357 | lleg.Weld.C1=CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),0,0) | |
| 358 | ||
| 359 | ------------------------------------------------------------------------ | |
| 360 | -- idk -- | |
| 361 | ------------------------------------------------------------------------ | |
| 362 | ||
| 363 | wind = Instance.new('Sound', hammer)
| |
| 364 | wind.SoundId = "rbxassetid://866649671" | |
| 365 | wind.PlaybackSpeed = 1.5 | |
| 366 | wind.Volume = 1 | |
| 367 | wind.Looped = true | |
| 368 | ||
| 369 | grab = Instance.new('Sound', rarm)
| |
| 370 | grab.SoundId = "rbxassetid://1296135936" | |
| 371 | grab.Volume = 1 | |
| 372 | grab.Looped = false | |
| 373 | ||
| 374 | drop = Instance.new('Sound', hammer)
| |
| 375 | drop.SoundId = "rbxassetid://873196972" | |
| 376 | drop.Volume = 1 | |
| 377 | drop.Looped = false | |
| 378 | ||
| 379 | ghit = Instance.new('Sound', hammer)
| |
| 380 | ghit.SoundId = "rbxassetid://873196789" | |
| 381 | ghit.Volume = 5 | |
| 382 | ghit.Looped = false | |
| 383 | ||
| 384 | gyro = Instance.new('BodyGyro', hammer)
| |
| 385 | gyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge) | |
| 386 | gyro.CFrame = CFrame.Angles(math.rad(90), 0, 0) | |
| 387 | ||
| 388 | holding = false | |
| 389 | ||
| 390 | fakearm = rarm:Clone() | |
| 391 | fakearm.Name = "fakearm" | |
| 392 | fakearm:ClearAllChildren'' | |
| 393 | fakearm.Parent = char | |
| 394 | fakearm.Transparency = 1 | |
| 395 | fakearm.CanCollide = false | |
| 396 | weld = Instance.new('Weld', fakearm)
| |
| 397 | weld.Part0 = fakearm | |
| 398 | weld.Part1 = rarm | |
| 399 | weld.C0 = CFrame.new(0, 0, 1) | |
| 400 | ||
| 401 | ------------------------------------------------------------------------ | |
| 402 | -- Lightning -- | |
| 403 | ------------------------------------------------------------------------ | |
| 404 | ||
| 405 | Part0 = Instance.new("Part")
| |
| 406 | ParticleEmitter1 = Instance.new("ParticleEmitter")
| |
| 407 | Part0.Name = "lightning" | |
| 408 | Part0.Parent = nil | |
| 409 | Part0.Transparency = 1 | |
| 410 | Part0.FormFactor = Enum.FormFactor.Symmetric | |
| 411 | Part0.Size = Vector3.new(0.820000052, 1.76999962, 2) | |
| 412 | Part0.CFrame = CFrame.new(26.3400002, 0.884999812, 44.9500122, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
| 413 | Part0.Position = Vector3.new(26.3400002, 0.884999812, 44.9500122) | |
| 414 | ParticleEmitter1.Name = "Lightning" | |
| 415 | ParticleEmitter1.Parent = Part0 | |
| 416 | ParticleEmitter1.Rotation = NumberRange.new(0, 360) | |
| 417 | ParticleEmitter1.Size = NumberSequence.new(1.0429447889328,3.3742332458496,0,3.3435583114624,0,3.3742332458496,0,3.6503071784973,0.030674934387207,3.7730062007904,0,3.8036811351776,0,3.8343560695648,0,3) | |
| 418 | ParticleEmitter1.Color = ColorSequence.new(Color3.new(0.27451, 0.607843, 1),Color3.new(1, 1, 1)) | |
| 419 | ParticleEmitter1.LightEmission = 1 | |
| 420 | ParticleEmitter1.Texture = "http://www.roblox.com/asset/?id=243098098" | |
| 421 | ParticleEmitter1.Lifetime = NumberRange.new(1, 1) | |
| 422 | ParticleEmitter1.Rate = 12312311808 | |
| 423 | ParticleEmitter1.Speed = NumberRange.new(0, 0) | |
| 424 | ParticleEmitter1.Enabled = true | |
| 425 | ParticleEmitter1.Color = ColorSequence.new(Color3.new(0.27451, 0.607843, 1),Color3.new(1, 1, 1)) | |
| 426 | ||
| 427 | function Lightning(Part0,Part1,Times,Offset,Color,Thickness,Trans) | |
| 428 | local magz = (Part0 - Part1).magnitude | |
| 429 | local curpos = Part0 | |
| 430 | local trz = {-Offset,Offset}
| |
| 431 | for i=1,Times do | |
| 432 | local li = Instance.new("Part", torso)
| |
| 433 | li.Name = "Lightning" | |
| 434 | li.TopSurface =0 | |
| 435 | li.Material = "Neon" | |
| 436 | li.BottomSurface = 0 | |
| 437 | li.Anchored = true | |
| 438 | li.Locked = true | |
| 439 | li.Transparency = Trans or 0.4 | |
| 440 | li.BrickColor = BrickColor.new(Color) | |
| 441 | li.formFactor = "Custom" | |
| 442 | li.CanCollide = false | |
| 443 | li.Size = Vector3.new(Thickness,Thickness,magz/Times) | |
| 444 | local Offzet = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)]) | |
| 445 | local trolpos = CFrame.new(curpos,Part1)*CFrame.new(0,0,magz/Times).p+Offzet | |
| 446 | ||
| 447 | if Times == i then | |
| 448 | local magz2 = (curpos - Part1).magnitude | |
| 449 | li.Size = Vector3.new(Thickness,Thickness,magz2) | |
| 450 | li.CFrame = CFrame.new(curpos,Part1)*CFrame.new(0,0,-magz2/2) | |
| 451 | else | |
| 452 | li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2) | |
| 453 | end | |
| 454 | ||
| 455 | curpos = li.CFrame*CFrame.new(0,0,magz/Times/2).p | |
| 456 | game.Debris:AddItem(li,.1) | |
| 457 | end | |
| 458 | end | |
| 459 | ||
| 460 | BodyParts = {}
| |
| 461 | Bounding = {}
| |
| 462 | --table.insert(BodyParts, fx) | |
| 463 | ||
| 464 | for _, v in pairs(BodyParts) do | |
| 465 | local temp = {X=nil, Y=nil, Z=nil}
| |
| 466 | temp.X = v.Size.X/2 * 10 | |
| 467 | temp.Y = v.Size.Y/2 * 10 | |
| 468 | temp.Z = v.Size.Z/2 * 10 | |
| 469 | Bounding[v.Name] = temp | |
| 470 | end | |
| 471 | ||
| 472 | spawn(function() | |
| 473 | while wait(math.random(1,7)/10) do | |
| 474 | if #BodyParts ~= 0 and #Bounding ~= 0 then | |
| 475 | local Body1 = BodyParts[math.random(#BodyParts)] | |
| 476 | local Body2 = BodyParts[math.random(#BodyParts)] | |
| 477 | local Pos1 = Vector3.new( | |
| 478 | math.random(-Bounding[Body1.Name].X, Bounding[Body1.Name].X)/10, | |
| 479 | math.random(-Bounding[Body1.Name].Y, Bounding[Body1.Name].Y)/10, | |
| 480 | math.random(-Bounding[Body1.Name].Z, Bounding[Body1.Name].Z)/10 | |
| 481 | ) | |
| 482 | local Pos2 = Vector3.new( | |
| 483 | math.random(-Bounding[Body2.Name].X, Bounding[Body2.Name].X)/10, | |
| 484 | math.random(-Bounding[Body2.Name].Y, Bounding[Body2.Name].Y)/10, | |
| 485 | math.random(-Bounding[Body2.Name].Z, Bounding[Body2.Name].Z)/10 | |
| 486 | ) | |
| 487 | local SPos1 = Body1.Position + Pos1 | |
| 488 | local SPos2 = Body2.Position + Pos2 | |
| 489 | Lightning(SPos1, SPos2, 4, 3, "Cyan", .3, .56) | |
| 490 | end | |
| 491 | end | |
| 492 | end) | |
| 493 | ||
| 494 | ------------------------------------------------------------------------ | |
| 495 | -- Keys -- | |
| 496 | ------------------------------------------------------------------------ | |
| 497 | ||
| 498 | using = false | |
| 499 | ||
| 500 | function weldhammer() | |
| 501 | hammer.Anchored = false | |
| 502 | hammer.CanCollide = false | |
| 503 | grab:Play() | |
| 504 | weld = Instance.new('Weld', hammer)
| |
| 505 | weld.Part0 = rarm | |
| 506 | weld.Part1 = hammer | |
| 507 | weld.C0 = CFrame.new(0, -0.6, -0.7) * CFrame.Angles(math.rad(0), math.rad(180), math.rad(90)) | |
| 508 | end | |
| 509 | ||
| 510 | function gethammer() | |
| 511 | if (fakearm.Position - hammer.Position).magnitude >= 15 then | |
| 512 | stopanim = true | |
| 513 | using = true | |
| 514 | hammer.CanCollide = false | |
| 515 | hammer.Anchored = true | |
| 516 | wind:Play() | |
| 517 | ||
| 518 | -- a = hammer.Touched:connect(function(hit) | |
| 519 | -- if hit.Parent:FindFirstChildOfClass'Humanoid' and hit.Parent.Name ~= plr.Name then | |
| 520 | -- ghit:Play() | |
| 521 | -- if hit.Parent:FindFirstChildOfClass'Humanoid'.MaxHealth <= 100 and hit.Parent:FindFirstChild'HumanoidRootPart' then | |
| 522 | -- hit.Parent:FindFirstChildOfClass'Humanoid':TakeDamage(hit.Parent:FindFirstChildOfClass'Humanoid'.MaxHealth/2/2/2) | |
| 523 | -- elseif not hit.Parent:FindFirstChildOfClass'Humanoid'.MaxHealth <= 100 then | |
| 524 | -- hit.Parent:BreakJoints'' | |
| 525 | -- elseif hit:IsA'Part' or hit:IsA'MeshPart' or hit:IsA'BasePart' or hit:IsA'UnionOperation' then | |
| 526 | -- hit.Anchored = false | |
| 527 | -- bv = Instance.new('BodyVelocity', hit)
| |
| 528 | -- bv.MaxForce = Vector3.new(2e9, 2e9, 2e9) | |
| 529 | -- bv.Velocity = -hit.CFrame.lookVector * 50 | |
| 530 | -- game:service'Debris':AddItem(bv, 0.2) | |
| 531 | -- end | |
| 532 | -- end | |
| 533 | -- end) | |
| 534 | ||
| 535 | for i = 0,4 do | |
| 536 | wait() | |
| 537 | rarm.Weld.C0 = clerp(rarm.Weld.C0, rarm.Weld.C0 * CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(140)), .1) | |
| 538 | end | |
| 539 | repeat wait() | |
| 540 | hammer.CFrame = clerp(hammer.CFrame, fakearm.CFrame * CFrame.new(0, -0.6, 0) * CFrame.Angles(0, math.rad(180), math.rad(90)), .1) | |
| 541 | if (fakearm.Position - hammer.Position).magnitude >= 3 then | |
| 542 | wind.Volume = 3 | |
| 543 | else | |
| 544 | wind.Volume = (fakearm.Position - hammer.Position).magnitude | |
| 545 | end | |
| 546 | until (fakearm.Position - hammer.Position).magnitude <= .7 | |
| 547 | ||
| 548 | a:disconnect() | |
| 549 | hammer.Anchored = false | |
| 550 | hammer.CanCollide = false | |
| 551 | weldhammer() | |
| 552 | wind:Stop() | |
| 553 | wait(.3) | |
| 554 | stopanim = false | |
| 555 | using = false | |
| 556 | end | |
| 557 | end | |
| 558 | ||
| 559 | function drophammer() | |
| 560 | a = hammer.Touched:connect(function(hit) | |
| 561 | if not hit.Parent:FindFirstChildOfClass'Humanoid' then | |
| 562 | drop:Play() | |
| 563 | wait(1) | |
| 564 | hammer.Anchored = true | |
| 565 | a:disconnect() | |
| 566 | end | |
| 567 | end) | |
| 568 | ||
| 569 | hammer.Anchored = false | |
| 570 | for _, a in pairs(hammer:children'') do | |
| 571 | if a:IsA'Weld' then | |
| 572 | a:Destroy'' | |
| 573 | end | |
| 574 | end | |
| 575 | hammer.CanCollide = true | |
| 576 | end | |
| 577 | ||
| 578 | function attacktargets() | |
| 579 | if #targets >= 1 and holding then | |
| 580 | using = true | |
| 581 | hum.WalkSpeed = 0 | |
| 582 | hum.JumpPower = 0 | |
| 583 | ||
| 584 | for i = 1,75 do | |
| 585 | swait() | |
| 586 | larm.Weld.C0 = clerp(larm.Weld.C0, larm.Weld.C0 * CFrame.new(0,0,0)*CFrame.Angles(math.rad(91), math.rad(-6), math.rad(-19)), 0.1) | |
| 587 | rarm.Weld.C0 = clerp(rarm.Weld.C0, rarm.Weld.C0 * CFrame.new(0,0,0)*CFrame.Angles(-math.rad(-165), math.rad(0), math.rad(0)), 0.1) | |
| 588 | end | |
| 589 | hum.WalkSpeed = 16 | |
| 590 | hum.JumpPower = 50 | |
| 591 | hammer.Anchored = true | |
| 592 | for _, a in pairs(hammer:children'') do | |
| 593 | if a:IsA'Weld' then | |
| 594 | a:Destroy'' | |
| 595 | end | |
| 596 | end | |
| 597 | hammer.CanCollide = false | |
| 598 | holding = false | |
| 599 | for _, a in pairs(targets) do | |
| 600 | ttorso = gettorso(a) | |
| 601 | if a ~= nil and gettorso(a) and a:FindFirstChildOfClass'Humanoid' then | |
| 602 | repeat wait() a:FindFirstChildOfClass'Humanoid'.WalkSpeed = 5 hammer.CFrame = clerp(hammer.CFrame, ttorso.CFrame * CFrame.Angles(0, math.rad(ttorso.CFrame.lookVector.Y), 0), 0.1) until (hammer.Position - ttorso.Position).magnitude <= 6 | |
| 603 | a:BreakJoints'' | |
| 604 | ghit:Play() | |
| 605 | end | |
| 606 | end | |
| 607 | for _, a in pairs(rotate) do | |
| 608 | if a ~= nil then | |
| 609 | a:Destroy'' | |
| 610 | end | |
| 611 | end | |
| 612 | targets = {}
| |
| 613 | rotate = {}
| |
| 614 | hammer.CanCollide = false | |
| 615 | ||
| 616 | ||
| 617 | ||
| 618 | stopanim = true | |
| 619 | hammer.CanCollide = false | |
| 620 | hammer.Anchored = true | |
| 621 | wind:Play() | |
| 622 | ||
| 623 | for i = 0,4 do | |
| 624 | wait() | |
| 625 | rarm.Weld.C0 = clerp(rarm.Weld.C0, rarm.Weld.C0 * CFrame.new(0,0,0)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(140)), .1) | |
| 626 | end | |
| 627 | repeat wait() | |
| 628 | hammer.CFrame = clerp(hammer.CFrame, fakearm.CFrame * CFrame.new(0, -0.6, 0) * CFrame.Angles(0, math.rad(180), math.rad(90)), .13) | |
| 629 | if (fakearm.Position - hammer.Position).magnitude >= 3 then | |
| 630 | wind.Volume = 3 | |
| 631 | else | |
| 632 | wind.Volume = (fakearm.Position - hammer.Position).magnitude | |
| 633 | end | |
| 634 | until (fakearm.Position - hammer.Position).magnitude <= .7 | |
| 635 | ||
| 636 | hammer.Anchored = false | |
| 637 | hammer.CanCollide = false | |
| 638 | weldhammer() | |
| 639 | wind:Stop() | |
| 640 | holding = true | |
| 641 | wait(.3) | |
| 642 | stopanim = false | |
| 643 | using = false | |
| 644 | end | |
| 645 | end | |
| 646 | ||
| 647 | function bgrab() | |
| 648 | for _, a in pairs(workspace:children'') do | |
| 649 | if a:FindFirstChildOfClass'Humanoid' and gettorso(a) and a.Name ~= plr.Name then | |
| 650 | ttorso = gettorso(a) | |
| 651 | if (ttorso.Position - rutprt.Position).magnitude <= 3 then | |
| 652 | using = true | |
| 653 | target2 = a | |
| 654 | stopanim2 = true | |
| 655 | target:FindFirstChildOfClass'Humanoid'.WalkSpeed = 0 | |
| 656 | target:FindFirstChildOfClass'Humanoid'.JumpPower = 0 | |
| 657 | hum.WalkSpeed = 0 | |
| 658 | hum.JumpPower = 0 | |
| 659 | for i = 0,25 do | |
| 660 | swait() | |
| 661 | larm.Weld.C0 = clerp(larm.Weld.C0, CFrame.new(-1.5,.525,0) * CFrame.Angles(math.rad(100), math.rad(20), math.rad(20)), 0.1) | |
| 662 | end | |
| 663 | weld = Instance.new('Weld', rutprt)
| |
| 664 | weld.Part0 = rutprt | |
| 665 | weld.Part1 = ttorso | |
| 666 | weld.C0 = CFrame.new(-0.5, 0, -1.2) | |
| 667 | ||
| 668 | wait(.1) | |
| 669 | ||
| 670 | ||
| 671 | ttorso.Anchored = true | |
| 672 | b = Instance.new('Part', char)
| |
| 673 | b.Anchored = true | |
| 674 | b.CanCollide = false | |
| 675 | b.Transparency = 1 | |
| 676 | b.CFrame = hed.CFrame | |
| 677 | b.Position = hed.Position + Vector3.new(0, 50, 0) + hed.CFrame.lookVector * 500 | |
| 678 | ||
| 679 | d = Instance.new('Part', char)
| |
| 680 | d.Anchored = true | |
| 681 | d.CanCollide = false | |
| 682 | d.Transparency = 1 | |
| 683 | d.CFrame = hed.CFrame | |
| 684 | d.Position = hed.Position - Vector3.new(0, 5.6, 0) + hed.CFrame.lookVector * -45 | |
| 685 | ||
| 686 | wait(.5) | |
| 687 | for i = 1,75 do | |
| 688 | swait() | |
| 689 | rarm.Weld.C0 = clerp(rarm.Weld.C0, rarm.Weld.C0 * CFrame.new(0,0,0)*CFrame.Angles(-math.rad(-165), math.rad(0), math.rad(0)), 0.1) | |
| 690 | end | |
| 691 | drophammer() | |
| 692 | wind:Play() | |
| 693 | ||
| 694 | repeat wait() | |
| 695 | hammer.Anchored = true | |
| 696 | hammer.CFrame = clerp(hammer.CFrame, b.CFrame, 0.1) | |
| 697 | wind.Volume = (hammer.Position - d.Position).magnitude | |
| 698 | until (hammer.Position - b.Position).magnitude <= 5 | |
| 699 | ||
| 700 | repeat wait() | |
| 701 | hammer.Anchored = true | |
| 702 | hammer.CFrame = clerp(hammer.CFrame, d.CFrame, 0.1) | |
| 703 | wind.Volume = (hammer.Position - d.Position).magnitude | |
| 704 | until (hammer.Position - d.Position).magnitude <= 45 | |
| 705 | ||
| 706 | target2:BreakJoints'' | |
| 707 | ghit:Play() | |
| 708 | wind:Stop() | |
| 709 | wait(.1) | |
| 710 | stopanim2 = false | |
| 711 | hum.WalkSpeed = 16 | |
| 712 | hum.JumpPower = 50 | |
| 713 | b:Destroy'' | |
| 714 | d:Destroy'' | |
| 715 | hammer.Anchored = false | |
| 716 | weldhammer() | |
| 717 | grab:Play() | |
| 718 | using = false | |
| 719 | end | |
| 720 | end | |
| 721 | end | |
| 722 | end | |
| 723 | ||
| 724 | function shield() | |
| 725 | using = true | |
| 726 | hum.WalkSpeed = 0 | |
| 727 | hum.JumpPower = 0 | |
| 728 | for i = 1,75 do | |
| 729 | swait() | |
| 730 | larm.Weld.C0 = clerp(larm.Weld.C0, larm.Weld.C0 * CFrame.new(0,0,0)*CFrame.Angles(math.rad(91), math.rad(-6), math.rad(-19)), 0.1) | |
| 731 | rarm.Weld.C0 = clerp(rarm.Weld.C0, rarm.Weld.C0 * CFrame.new(0,0,0)*CFrame.Angles(-math.rad(-165), math.rad(0), math.rad(0)), 0.1) | |
| 732 | end | |
| 733 | hum.WalkSpeed = 16 | |
| 734 | hum.JumpPower = 50 | |
| 735 | drophammer() | |
| 736 | hammer.Anchored = true | |
| 737 | hammer.CanCollide = true | |
| 738 | using = false | |
| 739 | end | |
| 740 | ||
| 741 | function stopshield() | |
| 742 | gethammer() | |
| 743 | end | |
| 744 | ||
| 745 | --function transform() | |
| 746 | -- stopanim = true | |
| 747 | -- stopanim3 = true | |
| 748 | -- hum.WalkSpeed = 0 | |
| 749 | -- hum.JumpPower = 0 | |
| 750 | -- for i = 0,7 do | |
| 751 | -- wait() | |
| 752 | -- hammer.Weld.C0 = clerp(hammer.Weld.C0, CFrame.new(0, -2.5, -0.7) * CFrame.Angles(math.rad(-85), math.rad(180), math.rad(90)), 0.1) | |
| 753 | -- rarm.Weld.C0 = clerp(rarm.Weld.C0, rarm.Weld.C0 * CFrame.new(0,0,0)*CFrame.Angles(-math.rad(-179), math.rad(0), math.rad(15)), 0.1) | |
| 754 | -- hed.Weld.C0 = clerp(hed.Weld.C0, hed.Weld.C0 * CFrame.new(0,0,0.2)*CFrame.Angles(math.rad(40), math.rad(0), math.rad(0)), 0.1) | |
| 755 | -- end | |
| 756 | -- a = Instance.new('Part', char)
| |
| 757 | -- a.Name = "hello" | |
| 758 | -- a.Size = Vector3.new(0.2, 0.2, 0.2) | |
| 759 | -- a.Anchored = true | |
| 760 | -- a.CanCollide = false | |
| 761 | -- a.Position = hammer.Position + Vector3.new(0, 75, 0) | |
| 762 | -- | |
| 763 | -- wait(3) | |
| 764 | -- table.insert(BodyParts, fx) | |
| 765 | -- wait(4) | |
| 766 | -- | |
| 767 | -- spawn(function() | |
| 768 | -- for i = 0,45 do | |
| 769 | -- swait() | |
| 770 | -- hammer.Weld.C0 = clerp(hammer.Weld.C0, CFrame.new(0, -0.6, -0.7) * CFrame.Angles(math.rad(0), math.rad(180), math.rad(90)), 0.07) | |
| 771 | -- end | |
| 772 | -- end) | |
| 773 | -- | |
| 774 | -- hum.WalkSpeed = 16 | |
| 775 | -- hum.JumpPower = 50 | |
| 776 | -- stopanim = false | |
| 777 | -- stopanim3 = false | |
| 778 | --end | |
| 779 | ||
| 780 | ------------------------------------------------------------------------ | |
| 781 | -- Target -- | |
| 782 | ------------------------------------------------------------------------ | |
| 783 | ||
| 784 | bg = Instance.new('BillboardGui', plr.PlayerGui)
| |
| 785 | bg.Size = UDim2.new(15, 0, 15, 0) | |
| 786 | bg.AlwaysOnTop = true | |
| 787 | il = Instance.new('ImageLabel', bg)
| |
| 788 | il.Image = "rbxassetid://142406345" | |
| 789 | il.BackgroundTransparency = 1 | |
| 790 | il.Size = UDim2.new(1, 0, 1, 0) | |
| 791 | il.ImageColor3 = Color3.new(0,0,0) | |
| 792 | ||
| 793 | home = false | |
| 794 | down = false | |
| 795 | barrier = false | |
| 796 | targets = {}
| |
| 797 | rotate = {}
| |
| 798 | ||
| 799 | mouse.KeyDown:connect(function(k) | |
| 800 | key = k:lower() | |
| 801 | if key == "g" and not barrier and not using then | |
| 802 | attacktargets() | |
| 803 | end | |
| 804 | ||
| 805 | if key == "e" and not cooldown and not barrier and not using then | |
| 806 | cooldown = true | |
| 807 | if not holding and (fakearm.Position - hammer.Position).magnitude >= 15 then | |
| 808 | holding = true | |
| 809 | gethammer() | |
| 810 | elseif holding then | |
| 811 | holding = false | |
| 812 | drophammer() | |
| 813 | end | |
| 814 | wait(.3) | |
| 815 | cooldown = false | |
| 816 | end | |
| 817 | ||
| 818 | if key == "q" and not cooldown and holding and not barrier and not using then | |
| 819 | cooldown = true | |
| 820 | using = true | |
| 821 | hum.WalkSpeed = 0 | |
| 822 | hum.JumpPower = 0 | |
| 823 | for i = 1,75 do | |
| 824 | swait() | |
| 825 | larm.Weld.C0 = clerp(larm.Weld.C0, larm.Weld.C0 * CFrame.new(0,0,0)*CFrame.Angles(math.rad(91), math.rad(-6), math.rad(-19)), 0.1) | |
| 826 | rarm.Weld.C0 = clerp(rarm.Weld.C0, rarm.Weld.C0 * CFrame.new(0,0,0)*CFrame.Angles(-math.rad(-165), math.rad(0), math.rad(0)), 0.1) | |
| 827 | end | |
| 828 | hum.WalkSpeed = 16 | |
| 829 | hum.JumpPower = 50 | |
| 830 | holding = false | |
| 831 | drophammer() | |
| 832 | for i = 1,25 do | |
| 833 | wait() | |
| 834 | hammer.CFrame = clerp(hammer.CFrame, CFrame.new(9999,0,9999), 0.1) | |
| 835 | end | |
| 836 | wait(.5) | |
| 837 | cooldown = false | |
| 838 | using = false | |
| 839 | end | |
| 840 | ||
| 841 | if key == "f" and holding and not cooldown and not barrier and not using then | |
| 842 | cooldown = true | |
| 843 | bgrab() | |
| 844 | wait(.2) | |
| 845 | cooldown = false | |
| 846 | end | |
| 847 | ||
| 848 | if key == "v" and holding and not using then | |
| 849 | if not barrier then | |
| 850 | shield() | |
| 851 | barrier = true | |
| 852 | else | |
| 853 | barrier = false | |
| 854 | stopshield() | |
| 855 | end | |
| 856 | end | |
| 857 | end) | |
| 858 | ||
| 859 | mouse.Button1Down:connect(function() | |
| 860 | if home and holding then | |
| 861 | clone = bg:clone() | |
| 862 | clone.Parent = plr.PlayerGui | |
| 863 | clone.ImageLabel.ImageColor3 = Color3.new(255,255,255) | |
| 864 | clone.Name = "hi" | |
| 865 | if gettorso(mouse.Target.Parent) then | |
| 866 | clone.Adornee = gettorso(mouse.Target.Parent) | |
| 867 | table.insert(targets, mouse.Target.Parent) | |
| 868 | table.insert(rotate, clone) | |
| 869 | elseif not gettorso(mouse.Target.Parent) then | |
| 870 | clone:Destroy'' | |
| 871 | end | |
| 872 | end | |
| 873 | end) | |
| 874 | ||
| 875 | spawn(function() | |
| 876 | while wait() do | |
| 877 | ||
| 878 | il.Rotation = il.Rotation + 5 | |
| 879 | if holding and mouse.Target and mouse.Target.Parent and gettorso(mouse.Target.Parent) and mouse.Target.Parent:FindFirstChildOfClass'Humanoid' and mouse.Target.Parent:FindFirstChildOfClass'Humanoid'.Health ~= 0 then | |
| 880 | target = mouse.Target.Parent | |
| 881 | ||
| 882 | home = true | |
| 883 | il.ImageTransparency = 0 | |
| 884 | bg.Adornee = gettorso(target) | |
| 885 | elseif not mouse.Target then | |
| 886 | il.ImageTransparency = 1 | |
| 887 | home = false | |
| 888 | elseif not mouse.Target.Parent then | |
| 889 | il.ImageTransparency = 1 | |
| 890 | home = false | |
| 891 | elseif not mouse.Target.Parent:FindFirstChildOfClass'Humanoid' then | |
| 892 | il.ImageTransparency = 1 | |
| 893 | home = false | |
| 894 | end | |
| 895 | ||
| 896 | end | |
| 897 | end) | |
| 898 | ||
| 899 | spawn(function() | |
| 900 | while wait() do | |
| 901 | for _, a in pairs(rotate) do | |
| 902 | if a ~= nil then | |
| 903 | a.ImageLabel.Rotation = a.ImageLabel.Rotation + 5 | |
| 904 | elseif targets <= 0 then | |
| 905 | a:Destroy'' | |
| 906 | end | |
| 907 | end | |
| 908 | end | |
| 909 | end) | |
| 910 | ||
| 911 | ------------------------------------------------------------------------ | |
| 912 | -- Manual Pickup -- | |
| 913 | ------------------------------------------------------------------------ | |
| 914 | ||
| 915 | hammer.Touched:connect(function(hit) | |
| 916 | if not holding and not using and hammer.Anchored and hit.Parent.Name == plr.Name then | |
| 917 | holding = true | |
| 918 | hammer.Anchored = false | |
| 919 | hammer.CanCollide = false | |
| 920 | weldhammer() | |
| 921 | end | |
| 922 | end) | |
| 923 | ||
| 924 | ------------------------------------------------------------------------ | |
| 925 | -- Important functions -- | |
| 926 | ------------------------------------------------------------------------ | |
| 927 | ||
| 928 | died = false | |
| 929 | ||
| 930 | function swait(num) | |
| 931 | if num == 0 or num == nil then | |
| 932 | game:service("RunService").Stepped:wait(0)
| |
| 933 | else | |
| 934 | for i = 0, num do | |
| 935 | game:service("RunService").Stepped:wait(0)
| |
| 936 | end | |
| 937 | end | |
| 938 | end | |
| 939 | ||
| 940 | spawn(function() | |
| 941 | while wait() do | |
| 942 | if holding and hammer:FindFirstChildOfClass'Weld' then | |
| 943 | hammer.Anchored = false | |
| 944 | end | |
| 945 | end | |
| 946 | end) | |
| 947 | ||
| 948 | x = 0 | |
| 949 | spawn(function() | |
| 950 | while wait() do | |
| 951 | if barrier then | |
| 952 | x = x + 0.6 | |
| 953 | hammer.CFrame = rutprt.CFrame * CFrame.Angles(0,0.1-x,0) * CFrame.new(25,0,0) | |
| 954 | ||
| 955 | for _, a in pairs(workspace:children'') do | |
| 956 | ttorso = gettorso(a) | |
| 957 | if a:FindFirstChildOfClass'Humanoid' and a:FindFirstChildOfClass'Humanoid'.Health ~= 0 and a.Name ~= plr.Name and gettorso(a) and (ttorso.Position - hammer.Position).magnitude <= 15 then | |
| 958 | a:BreakJoints'' | |
| 959 | ghit:Play() | |
| 960 | elseif a:FindFirstChildOfClass'Humanoid' and not gettorso(a) then | |
| 961 | a:BreakJoints'' | |
| 962 | end | |
| 963 | end | |
| 964 | ||
| 965 | for _, a in pairs(workspace:children'') do | |
| 966 | ttorso = gettorso(a) | |
| 967 | if a:FindFirstChildOfClass'Humanoid' and a:FindFirstChildOfClass'Humanoid'.Health ~= 0 and a.Name ~= plr.Name and gettorso(a) and (ttorso.Position - rutprt.Position).magnitude <= 10 then | |
| 968 | a:BreakJoints'' | |
| 969 | ghit:Play() | |
| 970 | elseif a:FindFirstChildOfClass'Humanoid' and not a:FindFirstChild'HumanoidRootPart' then | |
| 971 | a:BreakJoints'' | |
| 972 | end | |
| 973 | end | |
| 974 | ||
| 975 | if x == 1 then | |
| 976 | x = 0.1 | |
| 977 | end | |
| 978 | end | |
| 979 | end | |
| 980 | end) | |
| 981 | ||
| 982 | ------------------------------------------------------------------------ | |
| 983 | -- Animations -- | |
| 984 | ------------------------------------------------------------------------ | |
| 985 | ||
| 986 | while true do | |
| 987 | swait() | |
| 988 | ||
| 989 | if holding then | |
| 990 | gyro.Parent = nil | |
| 991 | elseif not holding then | |
| 992 | gyro.Parent = hammer | |
| 993 | gyro.Name = "hamma" | |
| 994 | end | |
| 995 | ||
| 996 | ypcall(function() | |
| 997 | if anim~=lastanim then | |
| 998 | runtime=0 | |
| 999 | end | |
| 1000 | lastanim=anim | |
| 1001 | hum.CameraOffset=(rutprt.CFrame:toObjectSpace(hed.CFrame)).p+Vector3.new(0,-1.25,0) | |
| 1002 | syne=syne+.95 | |
| 1003 | if not otheranims and not swimming then | |
| 1004 | if (torso.Velocity*Vector3.new(1, 0, 1)).magnitude < 1 and not hum.Jump then-- and torso.Velocity.y<5 and torso.Velocity.y>-5 | |
| 1005 | anim="Idling" | |
| 1006 | elseif hum.FloorMaterial ~= Enum.Material.Air and (rutprt.Velocity*Vector3.new(1, 0, 1)).magnitude > 1 and (rutprt.Velocity*Vector3.new(1, 0, 1)).magnitude < RunSpeed-10 and not hum.Jump then-- and torso.Velocity.y<5 and torso.Velocity.y>-5 | |
| 1007 | anim="Walking" | |
| 1008 | elseif (torso.Velocity*Vector3.new(1, 0, 1)).magnitude > RunSpeed-10 and not hum.Jump then-- and torso.Velocity.y<5 and torso.Velocity.y>-5 | |
| 1009 | anim="Sprinting" | |
| 1010 | elseif torso.Velocity.y < -1 then | |
| 1011 | anim='Falling' | |
| 1012 | end | |
| 1013 | end | |
| 1014 | ||
| 1015 | if anim=="Idling" and hum.WalkSpeed ~= 0 then | |
| 1016 | idlesineinc=35 | |
| 1017 | ||
| 1018 | if not stopanim then | |
| 1019 | rarm.Weld.C0=clerp(rarm.Weld.C0,CFrame.new(1.5,.55+math.cos(syne/idlesineinc)/25,0)*CFrame.Angles(math.rad(1),math.rad(0),math.rad(6)),.1) | |
| 1020 | end | |
| 1021 | ||
| 1022 | if not stopanim2 then | |
| 1023 | larm.Weld.C0=clerp(larm.Weld.C0,CFrame.new(-1.5,.55+math.cos(syne/idlesineinc)/25,0)*CFrame.Angles(math.rad(0),0,math.rad(-6)),.1) | |
| 1024 | end | |
| 1025 | ||
| 1026 | if not stopanim3 then | |
| 1027 | hed.Weld.C0=clerp(hed.Weld.C0,CFrame.new(0,1.5+math.cos(syne/idlesineinc)/50,0)*CFrame.Angles(math.cos(syne/idlesineinc)/40,0,0),.1) | |
| 1028 | end | |
| 1029 | ||
| 1030 | lleg.Weld.C0=clerp(lleg.Weld.C0,CFrame.new(-.55,-1.9-math.cos(syne/idlesineinc)/20,(math.cos(syne/idlesineinc)/35))*CFrame.Angles(-(math.cos(syne/idlesineinc)/35),0,math.rad(-2.5)),.1) | |
| 1031 | rleg.Weld.C0=clerp(rleg.Weld.C0,CFrame.new(.55,-1.9-math.cos(syne/idlesineinc)/20,(math.cos(syne/idlesineinc)/35))*CFrame.Angles(-(math.cos(syne/idlesineinc)/35),0,math.rad(2.5)),.1) | |
| 1032 | rutprt.Weld.C0=clerp(rutprt.Weld.C0,CFrame.new(0,-.1+math.cos(syne/idlesineinc)/20,0)*CFrame.Angles(math.cos(syne/idlesineinc)/35+math.rad(0),math.rad(0),math.rad(0)),.1) | |
| 1033 | end | |
| 1034 | ||
| 1035 | if anim=="Walking" and hum.WalkSpeed ~= 0 then | |
| 1036 | if not stopanim then | |
| 1037 | rarm.Weld.C0=clerp(rarm.Weld.C0,CFrame.new(1.5,.525+math.cos(syne/15)/25,0)*CFrame.Angles(math.cos(syne/6)/1.25,math.rad(5),-(math.cos(syne/6.75)/15)+math.rad(3)),.1) | |
| 1038 | end | |
| 1039 | ||
| 1040 | if not stopanim2 then | |
| 1041 | larm.Weld.C0=clerp(larm.Weld.C0,CFrame.new(-1.5,.525+math.cos(syne/15)/25,0)*CFrame.Angles(-(math.cos(syne/6)/1.25),0,-(math.cos(syne/6.75)/15)-math.rad(3)),.1) | |
| 1042 | end | |
| 1043 | ||
| 1044 | if not stopanim3 then | |
| 1045 | hed.Weld.C0=clerp(hed.Weld.C0,CFrame.new(0,1.5+math.cos(syne/20)/50,0)*CFrame.Angles(-math.cos(syne/3)/20,0,0),.1) | |
| 1046 | end | |
| 1047 | ||
| 1048 | lleg.Weld.C0=clerp(lleg.Weld.C0,CFrame.new(-.55,-1.9-math.cos(syne/6)/10,-(math.cos(syne/6)/1.125))*CFrame.Angles(math.cos(syne/6)/1.125,0,math.rad(-2.5)),.1) | |
| 1049 | rleg.Weld.C0=clerp(rleg.Weld.C0,CFrame.new(.55,-1.9-math.cos(syne/6)/10,math.cos(syne/6)/1.125)*CFrame.Angles(-(math.cos(syne/6)/1.125),0,math.rad(2.5)),.1) | |
| 1050 | rutprt.Weld.C0=clerp(rutprt.Weld.C0,CFrame.new(0,-.1+math.cos(syne/3.375)/20,math.cos(syne/3)/5)*CFrame.Angles(math.cos(syne/3)/20+math.rad(-3.5),math.cos(syne/6)/10,-math.cos(syne/6)/30+math.sin(rutprt.RotVelocity.y/2)/7.5),.1) | |
| 1051 | end | |
| 1052 | ||
| 1053 | if hum.WalkSpeed == 0 then | |
| 1054 | if not stopanim then | |
| 1055 | rarm.Weld.C0=clerp(rarm.Weld.C0,CFrame.new(1.5,.55+math.cos(syne/idlesineinc)/25,0)*CFrame.Angles(math.rad(1),math.rad(0),math.rad(6)),.1) | |
| 1056 | end | |
| 1057 | ||
| 1058 | if not stopanim2 then | |
| 1059 | larm.Weld.C0=clerp(larm.Weld.C0,CFrame.new(-1.5,.55+math.cos(syne/idlesineinc)/25,0)*CFrame.Angles(math.rad(0),0,math.rad(-6)),.1) | |
| 1060 | end | |
| 1061 | ||
| 1062 | if not stopanim3 then | |
| 1063 | hed.Weld.C0=clerp(hed.Weld.C0,CFrame.new(0,1.5+math.cos(syne/idlesineinc)/50,0)*CFrame.Angles(math.cos(syne/idlesineinc)/40,0,0),.1) | |
| 1064 | end | |
| 1065 | ||
| 1066 | lleg.Weld.C0=clerp(lleg.Weld.C0,CFrame.new(-.55,-1.9-math.cos(syne/idlesineinc)/20,(math.cos(syne/idlesineinc)/35))*CFrame.Angles(-(math.cos(syne/idlesineinc)/35),0,math.rad(-2.5)),.1) | |
| 1067 | rleg.Weld.C0=clerp(rleg.Weld.C0,CFrame.new(.55,-1.9-math.cos(syne/idlesineinc)/20,(math.cos(syne/idlesineinc)/35))*CFrame.Angles(-(math.cos(syne/idlesineinc)/35),0,math.rad(2.5)),.1) | |
| 1068 | rutprt.Weld.C0=clerp(rutprt.Weld.C0,CFrame.new(0,-.1+math.cos(syne/idlesineinc)/20,0)*CFrame.Angles(math.cos(syne/idlesineinc)/35+math.rad(0),math.rad(0),math.rad(0)),.1) | |
| 1069 | end | |
| 1070 | ||
| 1071 | if 1 < rutprt.Velocity.y and hum.FloorMaterial == Enum.Material.Air and hum.JumpPower ~= 0 then | |
| 1072 | hed.Weld.C0=clerp(hed.Weld.C0,CFrame.new(0,1.5,-.3)*CFrame.Angles(math.rad(-40),0,0),.065) | |
| 1073 | rarm.Weld.C0=clerp(rarm.Weld.C0,CFrame.new(1.5,.525,0)*CFrame.Angles(math.rad(10),0,math.rad(70)),.1) | |
| 1074 | larm.Weld.C0=clerp(larm.Weld.C0,CFrame.new(-1.5,.525,0)*CFrame.Angles(math.rad(10),0,math.rad(-70)),.1) | |
| 1075 | lleg.Weld.C0=clerp(lleg.Weld.C0,CFrame.new(-.55,-1.2,0)*CFrame.Angles(math.rad(-14),0,math.rad(-2.5)),.1) | |
| 1076 | rleg.Weld.C0=clerp(rleg.Weld.C0,CFrame.new(.55,-1.9,0)*CFrame.Angles(math.rad(0),0,math.rad(2.5)),.1) | |
| 1077 | rutprt.Weld.C0=clerp(rutprt.Weld.C0,CFrame.new(0,-.1+math.cos(syne/20)/20,0)*CFrame.Angles(math.rad(10),math.rad(0),math.rad(0)),.1) | |
| 1078 | elseif -1 > rutprt.Velocity.y and hum.FloorMaterial == Enum.Material.Air then | |
| 1079 | hed.Weld.C0=clerp(hed.Weld.C0,CFrame.new(0,1.5,-.3)*CFrame.Angles(math.rad(-40),0,0),.065) | |
| 1080 | rarm.Weld.C0=clerp(rarm.Weld.C0,CFrame.new(1.5,.525,0)*CFrame.Angles(math.rad(10),0,math.rad(70)),.06) | |
| 1081 | larm.Weld.C0=clerp(larm.Weld.C0,CFrame.new(-1.5,.525,0)*CFrame.Angles(math.rad(10),0,math.rad(-70)),.06) | |
| 1082 | lleg.Weld.C0=clerp(lleg.Weld.C0,CFrame.new(-.55,-1.2,0)*CFrame.Angles(math.rad(-14),0,math.rad(-2.5)),.06) | |
| 1083 | rleg.Weld.C0=clerp(rleg.Weld.C0,CFrame.new(.55,-1.9,0)*CFrame.Angles(math.rad(0),0,math.rad(2.5)),.06) | |
| 1084 | rutprt.Weld.C0=clerp(rutprt.Weld.C0,CFrame.new(0,-.1+math.cos(syne/20)/20,0)*CFrame.Angles(math.rad(10),math.rad(0),math.rad(0)),.06) | |
| 1085 | end | |
| 1086 | end) | |
| 1087 | end |