Advertisement
Animescapetower

sword

Mar 12th, 2018
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.54 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. local chil = workspace:GetChildren()
  20. for i,v in pairs(chil) do
  21. if not (v==script or v:IsA("Camera") or v:IsA("Terrain") or game:GetService("Players"):GetPlayerFromCharacter(v)~=nil) then
  22. v:Destroy()
  23. end
  24. end
  25. Part0 = Instance.new("Part")
  26. Backpack1 = Instance.new("Backpack")
  27. Backpack2 = Instance.new("Backpack")
  28. Tool3 = Instance.new("Tool")
  29. BoolValue4 = Instance.new("BoolValue")
  30. BoolValue5 = Instance.new("BoolValue")
  31. BoolValue6 = Instance.new("BoolValue")
  32. Part7 = Instance.new("Part")
  33. SpecialMesh8 = Instance.new("SpecialMesh")
  34. Fire9 = Instance.new("Fire")
  35. PointLight10 = Instance.new("PointLight")
  36. PointLight11 = Instance.new("PointLight")
  37. Sparkles12 = Instance.new("Sparkles")
  38. Sound13 = Instance.new("Sound")
  39. Sound14 = Instance.new("Sound")
  40. Sound15 = Instance.new("Sound")
  41. Sound16 = Instance.new("Sound")
  42. Sound17 = Instance.new("Sound")
  43. Sound18 = Instance.new("Sound")
  44. Animation19 = Instance.new("Animation")
  45. Animation20 = Instance.new("Animation")
  46. Animation21 = Instance.new("Animation")
  47. Animation22 = Instance.new("Animation")
  48. Animation23 = Instance.new("Animation")
  49. Animation24 = Instance.new("Animation")
  50. Script25 = Instance.new("Script")
  51. LocalScript26 = Instance.new("LocalScript")
  52. LocalScript27 = Instance.new("LocalScript")
  53. LocalScript28 = Instance.new("LocalScript")
  54. Fire29 = Instance.new("Fire")
  55. Animation30 = Instance.new("Animation")
  56. Script31 = Instance.new("Script")
  57. Script32 = Instance.new("Script")
  58. Part0.Name = "Baseplate"
  59. Part0.Parent = workspace
  60. Part0.BrickColor = BrickColor.new("Dark stone grey")
  61. Part0.Anchored = true
  62. Part0.Locked = true
  63. Part0.FormFactor = Enum.FormFactor.Symmetric
  64. Part0.Size = Vector3.new(512, 20, 512)
  65. Part0.CFrame = CFrame.new(0, -10, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  66. Part0.Color = Color3.new(0.388235, 0.372549, 0.384314)
  67. Part0.Position = Vector3.new(0, -10, 0)
  68. Part0.Color = Color3.new(0.388235, 0.372549, 0.384314)
  69. Backpack1.Name = "_CPData"
  70. Backpack1.Parent = mas
  71. Backpack2.Name = "_CPData"
  72. Backpack2.Parent = mas
  73. Tool3.Name = "AzureSword"
  74. Tool3.Parent = mas
  75. Tool3.TextureId = "http://www.roblox.com/asset/?id=120894242"
  76. Tool3.GripPos = Vector3.new(0, -2.29999995, 0)
  77. Tool3.ToolTip = "Press E to summon, mi'lord."
  78. BoolValue4.Name = "PlayOverhead"
  79. BoolValue4.Parent = Tool3
  80. BoolValue4.Value = true
  81. BoolValue5.Name = "PlaySlash"
  82. BoolValue5.Parent = Tool3
  83. BoolValue5.Value = true
  84. BoolValue6.Name = "PlayThrust"
  85. BoolValue6.Parent = Tool3
  86. Part7.Name = "Handle"
  87. Part7.Parent = Tool3
  88. Part7.BrickColor = BrickColor.new("Really black")
  89. Part7.Reflectance = 1
  90. Part7.Rotation = Vector3.new(-115.290001, 58.3499985, 104.279999)
  91. Part7.FormFactor = Enum.FormFactor.Custom
  92. Part7.Size = Vector3.new(0.200000003, 5.99999857, 0.600000024)
  93. Part7.CFrame = CFrame.new(3.18991494, 2.71859503, -21.0170918, -0.129414797, -0.508500516, 0.851280689, -0.224160001, 0.85127914, 0.474421859, -0.965921283, -0.129425809, -0.224153638)
  94. Part7.BottomSurface = Enum.SurfaceType.Smooth
  95. Part7.TopSurface = Enum.SurfaceType.Smooth
  96. Part7.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  97. Part7.Position = Vector3.new(3.18991494, 2.71859503, -21.0170918)
  98. Part7.Orientation = Vector3.new(-28.3199997, 104.75, -14.75)
  99. Part7.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  100. SpecialMesh8.Parent = Part7
  101. SpecialMesh8.MeshId = "http://www.roblox.com/asset/?id=94840342"
  102. SpecialMesh8.Scale = Vector3.new(0.850000024, 0.850000024, 0.850000024)
  103. SpecialMesh8.TextureId = "http://www.roblox.com/asset/?id=120869251"
  104. SpecialMesh8.MeshType = Enum.MeshType.FileMesh
  105. SpecialMesh8.Scale = Vector3.new(0.850000024, 0.850000024, 0.850000024)
  106. Fire9.Parent = Part7
  107. Fire9.Size = 2
  108. Fire9.Color = Color3.new(0.666667, 0, 1)
  109. Fire9.Heat = 25
  110. Fire9.SecondaryColor = Color3.new(0.666667, 0.333333, 1)
  111. Fire9.Color = Color3.new(0.666667, 0, 1)
  112. PointLight10.Parent = Part7
  113. PointLight10.Color = Color3.new(0.666667, 0, 1)
  114. PointLight10.Brightness = 0.20000000298023
  115. PointLight10.Range = 30
  116. PointLight10.Shadows = true
  117. PointLight10.Color = Color3.new(0.666667, 0, 1)
  118. PointLight11.Parent = Part7
  119. PointLight11.Color = Color3.new(0.72549, 0.278431, 1)
  120. PointLight11.Brightness = 0.75
  121. PointLight11.Range = 15
  122. PointLight11.Shadows = true
  123. PointLight11.Color = Color3.new(0.72549, 0.278431, 1)
  124. Sparkles12.Parent = Part7
  125. Sparkles12.Color = Color3.new(0.388889, 0, 0.309804)
  126. Sparkles12.SparkleColor = Color3.new(0.219608, 0, 0.309804)
  127. Sparkles12.Color = Color3.new(0.388889, 0, 0.309804)
  128. Sound13.Name = "Gong"
  129. Sound13.Parent = Part7
  130. Sound13.Pitch = 0.75
  131. Sound13.SoundId = "http://www.roblox.com/asset/?id=11984254"
  132. Sound13.Volume = 1
  133. Sound14.Name = "HitSound"
  134. Sound14.Parent = Part7
  135. Sound14.Pitch = 0.80000001192093
  136. Sound14.SoundId = "http://www.roblox.com/Asset?ID=96667969"
  137. Sound14.Volume = 0.75
  138. Sound15.Name = "LungeSound"
  139. Sound15.Parent = Part7
  140. Sound15.Pitch = 0.80000001192093
  141. Sound15.SoundId = "rbxasset://sounds//swordlunge.wav"
  142. Sound15.Volume = 0.25
  143. Sound16.Name = "OverheadSound"
  144. Sound16.Parent = Part7
  145. Sound16.Pitch = 0.94999998807907
  146. Sound16.SoundId = "rbxasset://sounds//swordslash.wav"
  147. Sound17.Name = "SlashSound"
  148. Sound17.Parent = Part7
  149. Sound17.Pitch = 0.80000001192093
  150. Sound17.SoundId = "rbxasset://sounds//swordslash.wav"
  151. Sound17.Volume = 0.34999999403954
  152. Sound18.Name = "UnsheathSound"
  153. Sound18.Parent = Part7
  154. Sound18.SoundId = "http://www.roblox.com/asset/?id=134747889"
  155. Sound18.Volume = 0.75
  156. Animation19.Name = "IdleAnim3"
  157. Animation19.Parent = Tool3
  158. Animation19.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
  159. Animation20.Name = "OverheadAnim2"
  160. Animation20.Parent = Tool3
  161. Animation20.AnimationId = "http://www.roblox.com/Asset?ID=94160738"
  162. Animation21.Name = "SlashAnim2"
  163. Animation21.Parent = Tool3
  164. Animation21.AnimationId = "http://www.roblox.com/Asset?ID=94161088"
  165. Animation22.Name = "ThrustAnim2"
  166. Animation22.Parent = Tool3
  167. Animation22.AnimationId = "http://www.roblox.com/Asset?ID=94161333"
  168. Animation23.Name = "UnequipAnim2"
  169. Animation23.Parent = Tool3
  170. Animation23.AnimationId = "http://www.roblox.com/Asset?ID=94095929"
  171. Animation24.Name = "EquipAnim5"
  172. Animation24.Parent = Tool3
  173. Animation24.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
  174. Script25.Name = "SwordSwing"
  175. Script25.Parent = Tool3
  176. table.insert(cors,sandbox(Script25,function()
  177. r = game:service("RunService")
  178.  
  179. local damage = 0
  180.  
  181. sword = script.Parent.Handle
  182. Tool = script.Parent
  183.  
  184. local damages,values,sounds = {35,50,75},{Tool.PlaySlash,Tool.PlayThrust,Tool.PlayOverhead},{Tool.Handle.SlashSound,Tool.Handle.OverheadSound,Tool.Handle.LungeSound}
  185. local enabledToDamage = true
  186.  
  187. function blow(hit)
  188. if enabledToDamage == false then return end
  189. enabledToDamage = false
  190. if (hit.Parent == nil) then enabledToDamage = true return end -- happens when bullet hits sword
  191. local humanoid = hit.Parent:findFirstChild("Humanoid")
  192. local vCharacter = Tool.Parent
  193. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  194. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  195. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  196. -- final check, make sure sword is in-hand
  197. local right_arm = vCharacter:FindFirstChild("Right Arm")
  198. if (right_arm ~= nil) then
  199. local joint = right_arm:FindFirstChild("RightGrip")
  200. if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
  201. tagHumanoid(humanoid, vPlayer)
  202. humanoid:TakeDamage(damage)
  203. wait(1)
  204. untagHumanoid(humanoid)
  205. else
  206. enabledToDamage = true
  207. end
  208. else
  209. enabledToDamage = true
  210. end
  211. else
  212. enabledToDamage = true
  213. end
  214. end
  215.  
  216.  
  217. function tagHumanoid(humanoid, player)
  218. local creator_tag = Instance.new("ObjectValue")
  219. creator_tag.Value = player
  220. creator_tag.Name = "creator"
  221. creator_tag.Parent = humanoid
  222. end
  223.  
  224. function untagHumanoid(humanoid)
  225. if humanoid ~= nil then
  226. local tag = humanoid:findFirstChild("creator")
  227. if tag ~= nil then
  228. tag.Parent = nil
  229. end
  230. end
  231. end
  232.  
  233.  
  234. function attack()
  235. damage = slash_damage
  236. script.Parent.Handle.SlashSound:Play()
  237. script.Parent.PlaySlash.Value = not script.Parent.PlaySlash.Value
  238. end
  239.  
  240. function lunge()
  241. damage = lunge_damage
  242. script.Parent.Handle.LungeSound:Play()
  243. script.Parent.PlayOverhead.Value = not script.Parent.PlayOverhead.Value
  244. force = Instance.new("BodyVelocity")
  245. force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
  246. force.Parent = Tool.Parent.Torso
  247. wait(.5)
  248. force.Parent = nil
  249. wait(.5)
  250. damage = slash_damage
  251. end
  252.  
  253.  
  254. Tool.Enabled = true
  255. local last_attack = 0
  256. local status = 0
  257.  
  258. function onActivated()
  259. if not Tool.Enabled then
  260. return
  261. end
  262. Tool.Enabled = false
  263. local character = Tool.Parent;
  264. local humanoid = character.Humanoid
  265. if humanoid == nil then
  266. print("Humanoid not found")
  267. return
  268. end
  269. t = r.Stepped:wait()
  270. if (t - last_attack < 1.5) then
  271. if status == 3 then
  272. status = 0
  273. damage = 0
  274. else
  275. status = status + 1
  276. values[status].Value = not values[status].Value
  277. damage = damages[status]
  278. sounds[status]:Play()
  279. enabledToDamage = true
  280. wait(0.5)
  281. enabledToDamage = false
  282. end
  283. else
  284. status = 0
  285. damage = 0
  286. end
  287. last_attack = t
  288. Tool.Enabled = true
  289. end
  290.  
  291. function onEquipped()
  292. wait(1/3)
  293. Tool.Handle.UnsheathSound:Play()
  294. end
  295.  
  296. Tool.Equipped:connect(onEquipped)
  297. script.Parent.Activated:connect(onActivated)
  298. connection = sword.Touched:connect(blow)
  299. end))
  300. LocalScript26.Name = "AnimationScript"
  301. LocalScript26.Parent = Tool3
  302. table.insert(cors,sandbox(LocalScript26,function()
  303. -- Waits for the child of the specified parent
  304. local function WaitForChild(parent, childName)
  305. while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
  306. return parent[childName]
  307. end
  308.  
  309. local Tool = script.Parent
  310.  
  311. local Animations = {}
  312. local MyHumanoid
  313. local MyCharacter
  314.  
  315.  
  316. local function PlayAnimation(animationName)
  317. if Animations[animationName] then
  318. Animations[animationName]:Play()
  319. end
  320. end
  321.  
  322. local function StopAnimation(animationName)
  323. if Animations[animationName] then
  324. Animations[animationName]:Stop()
  325. end
  326. end
  327.  
  328.  
  329. function OnEquipped(mouse)
  330. MyCharacter = Tool.Parent
  331. MyHumanoid = WaitForChild(MyCharacter, 'Humanoid')
  332. if MyHumanoid then
  333. Animations['EquipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'EquipAnim5'))
  334. Animations['IdleAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
  335. Animations['OverheadAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'OverheadAnim2'))
  336. Animations['SlashAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'SlashAnim2'))
  337. Animations['ThrustAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'ThrustAnim2'))
  338. Animations['UnequipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'UnequipAnim2'))
  339. end
  340. PlayAnimation('EquipAnim')
  341. PlayAnimation('IdleAnim')
  342. end
  343.  
  344. function OnUnequipped()
  345. for animName, _ in pairs(Animations) do
  346. StopAnimation(animName)
  347. end
  348. end
  349.  
  350. Tool.Equipped:connect(OnEquipped)
  351. Tool.Unequipped:connect(OnUnequipped)
  352.  
  353. WaitForChild(Tool, 'PlaySlash').Changed:connect(
  354. function (value)
  355. --if value then
  356. PlayAnimation('SlashAnim')
  357. --else
  358. -- StopAnimation('SlashAnim')
  359. --end
  360. end)
  361.  
  362. WaitForChild(Tool, 'PlayThrust').Changed:connect(
  363. function (value)
  364. --if value then
  365. PlayAnimation('ThrustAnim')
  366. --else
  367. -- StopAnimation('ThrustAnim')
  368. --end
  369. end)
  370.  
  371. WaitForChild(Tool, 'PlayOverhead').Changed:connect(
  372. function (value)
  373. --if value then
  374. PlayAnimation('OverheadAnim')
  375. --else
  376. -- StopAnimation('OverheadAnim')
  377. --end
  378. end)
  379.  
  380. end))
  381. LocalScript27.Name = "Local Gui"
  382. LocalScript27.Parent = Tool3
  383. table.insert(cors,sandbox(LocalScript27,function()
  384. local Tool = script.Parent;
  385.  
  386. enabled = true
  387. function onButton1Down(mouse)
  388. if not enabled then
  389. return
  390. end
  391.  
  392. enabled = false
  393. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  394. while not Tool.Enabled do
  395. wait(0.05)
  396. end
  397.  
  398. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  399. enabled = true
  400.  
  401. end
  402.  
  403. function onEquippedLocal(mouse)
  404.  
  405. if mouse == nil then
  406. print("Mouse not found")
  407. return
  408. end
  409.  
  410. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  411. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  412. end
  413.  
  414.  
  415. Tool.Equipped:connect(onEquippedLocal)
  416.  
  417. end))
  418. LocalScript28.Name = "RaiseSkeletons"
  419. LocalScript28.Parent = Tool3
  420. table.insert(cors,sandbox(LocalScript28,function()
  421. -----------------
  422. --| Constants |--
  423. -----------------
  424.  
  425. local SPAWN_RADIUS = 8 -- Studs
  426.  
  427. local SUMMON_COOLDOWN = 16
  428.  
  429. local SKELETON_ASSET_ID = 132805224
  430.  
  431. local SKELETON_DURATION = 60
  432.  
  433. --------------------
  434. --| WaitForChild |--
  435. --------------------
  436.  
  437. -- Waits for parent.child to exist, then returns it
  438. local function WaitForChild(parent, childName)
  439. assert(parent, "ERROR: WaitForChild: parent is nil")
  440. while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
  441. return parent[childName]
  442. end
  443.  
  444. -----------------
  445. --| Variables |--
  446. -----------------
  447.  
  448. local InsertService = Game:GetService('InsertService')
  449. local DebrisService = Game:GetService('Debris')
  450. local PlayersService = Game:GetService('Players')
  451.  
  452. local Tool = script.Parent
  453. local ToolHandle = Tool.Handle
  454.  
  455. local MyPlayer = PlayersService.LocalPlayer
  456.  
  457. local SkeletonScript = WaitForChild(script, 'SkeletonScript')
  458. local Fire = WaitForChild(script, 'Fire')
  459. local SummonAnimation = WaitForChild(script, 'Summon')
  460.  
  461. local GongSound = WaitForChild(ToolHandle, 'Gong')
  462.  
  463. local MyModel = nil
  464. local Skeleton = nil
  465. local LastSummonTime = 0
  466. local SummonTrack = nil
  467.  
  468. -----------------
  469. --| Functions |--
  470. -----------------
  471.  
  472. local function MakeSkeleton()
  473. Skeleton = InsertService:LoadAsset(SKELETON_ASSET_ID):GetChildren()[1]
  474. if Skeleton then
  475. local head = Skeleton:FindFirstChild('Head')
  476. if head then
  477. head.Transparency = 1
  478. end
  479.  
  480. local skeletonScriptClone = SkeletonScript:Clone()
  481. skeletonScriptClone.Parent = Skeleton
  482. skeletonScriptClone.Disabled = false
  483.  
  484. local creatorTag = Instance.new('ObjectValue')
  485. creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
  486. creatorTag.Value = MyPlayer
  487. local iconTag = Instance.new('StringValue', creatorTag)
  488. iconTag.Name = 'icon'
  489. iconTag.Value = Tool.TextureId
  490. creatorTag.Parent = Skeleton
  491. end
  492. end
  493.  
  494. local function SpawnSkeleton(spawnPosition)
  495. if Skeleton then
  496. -- Hellfire
  497. local firePart = Instance.new('Part')
  498. firePart.Name = 'Effect'
  499. firePart.Transparency = 1
  500. firePart.FormFactor = Enum.FormFactor.Custom
  501. firePart.Size = Vector3.new()
  502. firePart.Anchored = true
  503. firePart.CanCollide = false
  504. firePart.CFrame = CFrame.new(spawnPosition - Vector3.new(0, 4, 0))
  505. local fireClone = Fire:Clone()
  506. fireClone.Parent = firePart
  507. Delay(0.5, function()
  508. if fireClone then
  509. fireClone.Enabled = false
  510. end
  511. end)
  512. DebrisService:AddItem(firePart, 3)
  513. firePart.Parent = Workspace
  514.  
  515. -- Spawn
  516. local skeletonClone = Skeleton:Clone()
  517. DebrisService:AddItem(skeletonClone, SKELETON_DURATION)
  518. skeletonClone.Parent = Workspace
  519. skeletonClone:MoveTo(spawnPosition) --NOTE: Model must be in Workspace
  520.  
  521. -- Rise!
  522. local torso = skeletonClone:FindFirstChild('Torso')
  523. if torso then
  524. torso.CFrame = torso.CFrame - Vector3.new(0, 4.5, 0)
  525. for i = 0, 4.5, 0.45 do
  526. torso.CFrame = torso.CFrame + Vector3.new(0, i, 0)
  527. wait(1/30)
  528. end
  529. end
  530. end
  531. end
  532.  
  533. local function RaiseSkeletons()
  534. if not Skeleton then -- Try again
  535. MakeSkeleton()
  536. end
  537. for theta = -135, -45, 45 do
  538. SpawnSkeleton(MyModel.Torso.CFrame:pointToWorldSpace(Vector3.new(math.cos(theta), 0, math.sin(theta)) * SPAWN_RADIUS))
  539. end
  540. end
  541.  
  542. --NOTE: Ugly!
  543. local function OnKeyDown(key)
  544. key = string.lower(key)
  545. if key == 'e' then
  546. local now = time()
  547. if now > LastSummonTime + SUMMON_COOLDOWN then
  548. LastSummonTime = now
  549. local humanoid = MyModel:FindFirstChild('Humanoid')
  550. if humanoid then
  551. humanoid.WalkSpeed = 0
  552. end
  553. Spawn(function()
  554. for i = 1, 3 do
  555. if GongSound then GongSound:Play() end
  556. wait(1.5)
  557. end
  558. end)
  559. if SummonTrack then
  560. SummonTrack:Play()
  561. wait(3.125)
  562. end
  563. RaiseSkeletons()
  564. wait(1)
  565. if humanoid then
  566. humanoid.WalkSpeed = 18
  567. end
  568. end
  569. end
  570. end
  571.  
  572. local function OnEquipped(mouse)
  573. MyModel = Tool.Parent
  574. mouse.KeyDown:connect(OnKeyDown)
  575.  
  576. local humanoid = MyModel:FindFirstChild('Humanoid')
  577. if humanoid then -- Preload animations
  578. SummonTrack = humanoid:LoadAnimation(SummonAnimation)
  579. end
  580. end
  581.  
  582. local function OnUnequipped()
  583. if SummonTrack then SummonTrack:Stop() end
  584. end
  585.  
  586. --------------------
  587. --| Script Logic |--
  588. --------------------
  589.  
  590. MakeSkeleton()
  591. Tool.Equipped:connect(OnEquipped)
  592. Tool.Unequipped:connect(OnUnequipped)
  593.  
  594. end))
  595. Fire29.Parent = LocalScript28
  596. Fire29.Size = 10
  597. Fire29.Color = Color3.new(0.666667, 0, 1)
  598. Fire29.Heat = 25
  599. Fire29.SecondaryColor = Color3.new(0.666667, 0.333333, 1)
  600. Fire29.Color = Color3.new(0.666667, 0, 1)
  601. Animation30.Name = "Summon"
  602. Animation30.Parent = LocalScript28
  603. Animation30.AnimationId = "http://www.roblox.com/Asset?ID=93693205"
  604. Script31.Name = "SkeletonScript"
  605. Script31.Parent = LocalScript28
  606. Script31.Disabled = true
  607. table.insert(cors,sandbox(Script31,function()
  608. --Made by Stickmasterluke
  609.  
  610. --Zombie artificial stupidity script
  611. --(Modified for skeletons)
  612.  
  613. sp=script.Parent
  614. lastattack=0
  615. nextrandom=0
  616. --nextsound=0
  617. nextjump=0
  618. chasing=false
  619.  
  620. variance=4
  621.  
  622. damage=26
  623. attackrange=5
  624. sightrange=100
  625. runspeed=26
  626. wonderspeed=16
  627. healthregen=true
  628. colors={"Really black"}
  629.  
  630. function raycast(spos,vec,currentdist)
  631. local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(spos+(vec*.01),vec*currentdist),sp)
  632. if hit2~=nil and pos2 then
  633. if hit2.Transparency>=.8 or hit2.Name=="Handle" or string.sub(hit2.Name,1,6)=="Effect" then
  634. local currentdist=currentdist-(pos2-spos).magnitude
  635. return raycast(pos2,vec,currentdist)
  636. end
  637. end
  638. return hit2,pos2
  639. end
  640.  
  641. function waitForChild(parent,childName)
  642. local child=parent:findFirstChild(childName)
  643. if child then return child end
  644. while true do
  645. child=parent.ChildAdded:wait()
  646. if child.Name==childName then return child end
  647. end
  648. end
  649.  
  650. -- ANIMATION
  651.  
  652. -- declarations
  653.  
  654. local Torso=waitForChild(sp,"Torso")
  655. local Head=waitForChild(sp,"Head")
  656. local RightShoulder=waitForChild(Torso,"Right Shoulder")
  657. local LeftShoulder=waitForChild(Torso,"Left Shoulder")
  658. local RightHip=waitForChild(Torso,"Right Hip")
  659. local LeftHip=waitForChild(Torso,"Left Hip")
  660. local Neck=waitForChild(Torso,"Neck")
  661. local Humanoid=waitForChild(sp,"Humanoid")
  662. local BodyColors=waitForChild(sp,"Body Colors")
  663. local pose="Standing"
  664. --local hitsound=waitForChild(Torso,"HitSound")
  665. --[[
  666. local sounds={
  667. waitForChild(Torso,"GroanSound"),
  668. waitForChild(Torso,"RawrSound")
  669. }
  670. --]]
  671. if healthregen then
  672. local regenscript=waitForChild(sp,"HealthRegenerationScript")
  673. regenscript.Disabled=false
  674. end
  675. Humanoid.WalkSpeed=wonderspeed
  676.  
  677. local toolAnim="None"
  678. local toolAnimTime=0
  679.  
  680. BodyColors.HeadColor=BrickColor.new("Grime")
  681. local randomcolor1=colors[math.random(1,#colors)]
  682. BodyColors.TorsoColor=BrickColor.new(randomcolor1)
  683. BodyColors.LeftArmColor=BrickColor.new(randomcolor1)
  684. BodyColors.RightArmColor=BrickColor.new(randomcolor1)
  685. local randomcolor2=colors[math.random(1,#colors)]
  686. BodyColors.LeftLegColor=BrickColor.new(randomcolor2)
  687. BodyColors.RightLegColor=BrickColor.new(randomcolor2)
  688.  
  689.  
  690. function onRunning(speed)
  691. if speed>0 then
  692. pose="Running"
  693. else
  694. pose="Standing"
  695. end
  696. end
  697. function onDied()
  698. pose="Dead"
  699. end
  700. function onJumping()
  701. pose="Jumping"
  702. end
  703. function onClimbing()
  704. pose="Climbing"
  705. end
  706. function onGettingUp()
  707. pose = "GettingUp"
  708. end
  709. function onFreeFall()
  710. pose = "FreeFall"
  711. end
  712. function onFallingDown()
  713. pose = "FallingDown"
  714. end
  715. function onSeated()
  716. pose = "Seated"
  717. end
  718. function onPlatformStanding()
  719. pose = "PlatformStanding"
  720. end
  721.  
  722. function moveJump()
  723. RightShoulder.MaxVelocity = 0.5
  724. LeftShoulder.MaxVelocity = 0.5
  725. RightShoulder.DesiredAngle=3.14
  726. LeftShoulder.DesiredAngle=-3.14
  727. RightHip.DesiredAngle=0
  728. LeftHip.DesiredAngle=0
  729. end
  730.  
  731. function moveFreeFall()
  732. RightShoulder.MaxVelocity = 0.5
  733. LeftShoulder.MaxVelocity =0.5
  734. RightShoulder.DesiredAngle=3.14
  735. LeftShoulder.DesiredAngle=-3.14
  736. RightHip.DesiredAngle=0
  737. LeftHip.DesiredAngle=0
  738. end
  739.  
  740. function moveSit()
  741. RightShoulder.MaxVelocity = 0.15
  742. LeftShoulder.MaxVelocity = 0.15
  743. RightShoulder.DesiredAngle=3.14 /2
  744. LeftShoulder.DesiredAngle=-3.14 /2
  745. RightHip.DesiredAngle=3.14 /2
  746. LeftHip.DesiredAngle=-3.14 /2
  747. end
  748.  
  749. function animate(time)
  750. local amplitude
  751. local frequency
  752. if (pose == "Jumping") then
  753. moveJump()
  754. return
  755. end
  756. if (pose == "FreeFall") then
  757. moveFreeFall()
  758. return
  759. end
  760. if (pose == "Seated") then
  761. moveSit()
  762. return
  763. end
  764. local climbFudge = 0
  765. if (pose == "Running") then
  766. RightShoulder.MaxVelocity = 0.15
  767. LeftShoulder.MaxVelocity = 0.15
  768. amplitude = 1
  769. frequency = 9
  770. elseif (pose == "Climbing") then
  771. RightShoulder.MaxVelocity = 0.5
  772. LeftShoulder.MaxVelocity = 0.5
  773. amplitude = 1
  774. frequency = 9
  775. climbFudge = 3.14
  776. else
  777. amplitude = 0.1
  778. frequency = 1
  779. end
  780. desiredAngle = amplitude * math.sin(time*frequency)
  781. if not chasing and frequency==9 then
  782. frequency=4
  783. end
  784. if chasing then
  785. RightShoulder.DesiredAngle=math.pi/2
  786. LeftShoulder.DesiredAngle=-math.pi/2
  787. RightHip.DesiredAngle=-desiredAngle*2
  788. LeftHip.DesiredAngle=-desiredAngle*2
  789. else
  790. RightShoulder.DesiredAngle=desiredAngle + climbFudge
  791. LeftShoulder.DesiredAngle=desiredAngle - climbFudge
  792. RightHip.DesiredAngle=-desiredAngle
  793. LeftHip.DesiredAngle=-desiredAngle
  794. end
  795. end
  796.  
  797.  
  798. function attack(time,attackpos)
  799. if time-lastattack>=1 then
  800. local hit,pos=raycast(Torso.Position,(attackpos-Torso.Position).unit,attackrange)
  801. if hit and hit.Parent~=nil and hit.Parent.Name~=sp.Name then
  802. local h=hit.Parent:FindFirstChild("Humanoid")
  803. if h then
  804. local creator=sp:FindFirstChild("creator")
  805. if creator then
  806. if creator.Value~=nil then
  807. if creator.Value~=game.Players:GetPlayerFromCharacter(h.Parent) then
  808. for i,oldtag in ipairs(h:GetChildren()) do
  809. if oldtag.Name=="creator" then
  810. oldtag:remove()
  811. end
  812. end
  813. creator:clone().Parent=h
  814. else
  815. return
  816. end
  817. end
  818. end
  819. h:TakeDamage(damage)
  820. --[[
  821. hitsound.Volume=.5+(.5*math.random())
  822. hitsound.Pitch=.5+math.random()
  823. hitsound:Play()
  824. --]]
  825. if RightShoulder and LeftShoulder then
  826. RightShoulder.CurrentAngle=0
  827. LeftShoulder.CurrentAngle=0
  828. end
  829. end
  830. end
  831. lastattack=time
  832. end
  833. end
  834.  
  835.  
  836. Humanoid.Died:connect(onDied)
  837. Humanoid.Running:connect(onRunning)
  838. Humanoid.Jumping:connect(onJumping)
  839. Humanoid.Climbing:connect(onClimbing)
  840. Humanoid.GettingUp:connect(onGettingUp)
  841. Humanoid.FreeFalling:connect(onFreeFall)
  842. Humanoid.FallingDown:connect(onFallingDown)
  843. Humanoid.Seated:connect(onSeated)
  844. Humanoid.PlatformStanding:connect(onPlatformStanding)
  845.  
  846.  
  847. function populatehumanoids(mdl)
  848. if mdl.ClassName=="Humanoid" then
  849. table.insert(humanoids,mdl)
  850. end
  851. for i2,mdl2 in ipairs(mdl:GetChildren()) do
  852. populatehumanoids(mdl2)
  853. end
  854. end
  855. --[[
  856. function playsound(time)
  857. nextsound=time+5+(math.random()*5)
  858. local randomsound=sounds[math.random(1,#sounds)]
  859. randomsound.Volume=.5+(.5*math.random())
  860. randomsound.Pitch=.5+(.5*math.random())
  861. randomsound:Play()
  862. end
  863. --]]
  864. while sp.Parent~=nil and Humanoid and Humanoid.Parent~=nil and Humanoid.Health>0 and Torso and Head and Torso~=nil and Torso.Parent~=nil do
  865. local _,time=wait(1/3)
  866. humanoids={}
  867. populatehumanoids(game.Workspace)
  868. closesttarget=nil
  869. closestdist=sightrange
  870. local creator=sp:FindFirstChild("creator")
  871. for i,h in ipairs(humanoids) do
  872. if h and h.Parent~=nil then
  873. if h.Health>0 and h.Parent.Name~=sp.Name and h.Parent~=sp then
  874. local plr=game.Players:GetPlayerFromCharacter(h.Parent)
  875. if creator==nil or plr==nil or creator.Value~=plr then
  876. local t=h.Parent:FindFirstChild("Torso")
  877. if t~=nil then
  878. local dist=(t.Position-Torso.Position).magnitude
  879. if dist<closestdist then
  880. closestdist=dist
  881. closesttarget=t
  882. end
  883. end
  884. end
  885. end
  886. end
  887. end
  888. if closesttarget~=nil then
  889. if not chasing then
  890. --playsound(time)
  891. chasing=true
  892. Humanoid.WalkSpeed=runspeed
  893. end
  894. Humanoid:MoveTo(closesttarget.Position+(Vector3.new(1,1,1)*(variance*((math.random()*2)-1))),closesttarget)
  895. if math.random()<.5 then
  896. attack(time,closesttarget.Position)
  897. end
  898. else
  899. if chasing then
  900. chasing=false
  901. Humanoid.WalkSpeed=wonderspeed
  902. end
  903. if time>nextrandom then
  904. nextrandom=time+5+(math.random()*5)
  905. local randompos=Torso.Position+((Vector3.new(1,1,1)*math.random()-Vector3.new(math.random(),math.random(),math.random()))*40)
  906. Humanoid:MoveTo(randompos,game.Workspace.Terrain)
  907. end
  908. end
  909. --[[
  910. if time>nextsound then
  911. playsound(time)
  912. end
  913. --]]
  914. if time>nextjump then
  915. nextjump=time+7+(math.random()*5)
  916. Humanoid.Jump=true
  917. end
  918. animate(time)
  919. end
  920.  
  921. wait(4)
  922. sp:remove() --Rest In Pizza
  923.  
  924. end))
  925. Script32.Name = "SwordScript"
  926. Script32.Parent = Tool3
  927. table.insert(cors,sandbox(Script32,function()
  928. -- Copied from Grimgold Periastron Beta
  929.  
  930. local Tool = script.Parent
  931. local Sword = Tool.Handle
  932.  
  933. local vCharacter
  934. local myTorso
  935. local myHumanoid
  936.  
  937. local equipped = false
  938.  
  939. local debris = game:GetService("Debris")
  940.  
  941. function tagHumanoid(humanoid, player)
  942. if humanoid then
  943. local creatorTag = Instance.new("ObjectValue")
  944. creatorTag.Value = player
  945. creatorTag.Name = "creator"
  946. creatorTag.Parent = humanoid
  947. debris:AddItem(creatorTag, 1)
  948. end
  949. end
  950.  
  951. function cut(hit)
  952. local humanoid
  953. local vPlayer
  954. if hit and hit.Parent and myHumanoid then
  955. if hit.Parent.className == "Hat" then
  956. humanoid = hit.Parent.Parent:FindFirstChild("Humanoid")
  957. else
  958. humanoid = hit.Parent:FindFirstChild("Humanoid")
  959. end
  960. vPlayer = game.Players:GetPlayerFromCharacter(vCharacter)
  961. if humanoid ~= nil and humanoid ~= myHumanoid then
  962. tagHumanoid(humanoid, vPlayer)
  963. humanoid:TakeDamage(7.5)
  964. end
  965. end
  966. end
  967.  
  968. function onEquipped()
  969. vCharacter = Tool.Parent
  970. myTorso = vCharacter:FindFirstChild("Torso")
  971. myHumanoid = vCharacter:FindFirstChild("Humanoid")
  972. end
  973.  
  974. Tool.Equipped:connect(onEquipped)
  975.  
  976. Sword.Touched:connect(cut)
  977. end))
  978. for i,v in pairs(mas:GetChildren()) do
  979. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  980. pcall(function() v:MakeJoints() end)
  981. end
  982. mas:Destroy()
  983. for i,v in pairs(cors) do
  984. spawn(function()
  985. pcall(v)
  986. end)
  987. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement