Advertisement
DaOMEGAa32

rainbow hammer

Oct 6th, 2019
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.05 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. Tool0 = Instance.new("Tool")
  20. Part1 = Instance.new("Part")
  21. Sound2 = Instance.new("Sound")
  22. Sound3 = Instance.new("Sound")
  23. Sound4 = Instance.new("Sound")
  24. Sound5 = Instance.new("Sound")
  25. SpecialMesh6 = Instance.new("SpecialMesh")
  26. Sparkles7 = Instance.new("Sparkles")
  27. Sparkles8 = Instance.new("Sparkles")
  28. Sparkles9 = Instance.new("Sparkles")
  29. Sparkles10 = Instance.new("Sparkles")
  30. Fire11 = Instance.new("Fire")
  31. Sound12 = Instance.new("Sound")
  32. LocalScript13 = Instance.new("LocalScript")
  33. Script14 = Instance.new("Script")
  34. Animation15 = Instance.new("Animation")
  35. Animation16 = Instance.new("Animation")
  36. Animation17 = Instance.new("Animation")
  37. Animation18 = Instance.new("Animation")
  38. LocalScript19 = Instance.new("LocalScript")
  39. Script20 = Instance.new("Script")
  40. Tool0.Name = "rainbow"
  41. Tool0.Parent = mas
  42. Tool0.TextureId = "http://www.roblox.com/asset/?id=72541473"
  43. Tool0.Grip = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0)
  44. Tool0.GripForward = Vector3.new(-1, -0, -0)
  45. Tool0.GripPos = Vector3.new(0, 0, -1.70000005)
  46. Tool0.GripRight = Vector3.new(0, 1, 0)
  47. Tool0.GripUp = Vector3.new(0, 0, 1)
  48. Part1.Name = "Handle"
  49. Part1.Parent = Tool0
  50. Part1.CFrame = CFrame.new(-221.490738, 62.8512993, 444.01767, 8.53538513e-05, 0.507240474, 0.861804485, -0.99999994, 0.000165462494, 1.60932541e-06, -0.000141739845, -0.861804485, 0.507240534)
  51. Part1.Orientation = Vector3.new(0, 59.5200005, -89.9899979)
  52. Part1.Position = Vector3.new(-221.490738, 62.8512993, 444.01767)
  53. Part1.Rotation = Vector3.new(0, 59.5200005, -89.9899979)
  54. Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
  55. Part1.Size = Vector3.new(1, 0.800000012, 6)
  56. Part1.BottomSurface = Enum.SurfaceType.Smooth
  57. Part1.BrickColor = BrickColor.new("Dark stone grey")
  58. Part1.Reflectance = 0.40000000596046
  59. Part1.TopSurface = Enum.SurfaceType.Smooth
  60. Part1.brickColor = BrickColor.new("Dark stone grey")
  61. Part1.FormFactor = Enum.FormFactor.Plate
  62. Part1.formFactor = Enum.FormFactor.Plate
  63. Sound2.Name = "SOUND_slash"
  64. Sound2.Parent = Part1
  65. Sound2.SoundId = "rbxassetid://722744682"
  66. Sound3.Name = "SOUND_equip"
  67. Sound3.Parent = Part1
  68. Sound3.SoundId = "rbxassetid://132073439"
  69. Sound3.Volume = 10
  70. Sound4.Name = "SOUND_down"
  71. Sound4.Parent = Part1
  72. Sound4.SoundId = "rbxassetid://130781643"
  73. Sound4.Volume = 10
  74. Sound5.Name = "SOUND_hitground"
  75. Sound5.Parent = Part1
  76. Sound5.SoundId = "rbxassetid://618667795"
  77. Sound5.Volume = 10
  78. SpecialMesh6.Parent = Part1
  79. SpecialMesh6.MeshId = "http://www.roblox.com/asset/?id=15924243"
  80. SpecialMesh6.Scale = Vector3.new(1.20000005, 1, 1.20000005)
  81. SpecialMesh6.TextureId = "http://www.roblox.com/asset/?id=836795717"
  82. SpecialMesh6.MeshType = Enum.MeshType.FileMesh
  83. Sparkles7.Parent = Part1
  84. Sparkles8.Parent = Part1
  85. Sparkles8.Color = Color3.new(1.77083, 3.4, 0)
  86. Sparkles8.SparkleColor = Color3.new(1, 0.333333, 0)
  87. Sparkles9.Parent = Part1
  88. Sparkles9.Color = Color3.new(1.18056, 10.2, 1)
  89. Sparkles9.SparkleColor = Color3.new(0.666667, 1, 1)
  90. Sparkles10.Parent = Part1
  91. Sparkles10.Color = Color3.new(1.77083, 9.48, 0.145098)
  92. Sparkles10.SparkleColor = Color3.new(1, 0.929412, 0.145098)
  93. Fire11.Parent = Part1
  94. Fire11.Color = Color3.new(1, 0, 0)
  95. Fire11.Heat = 14
  96. Sound12.Name = "Rainbow"
  97. Sound12.Parent = Part1
  98. Sound12.Looped = true
  99. Sound12.Playing = true
  100. Sound12.SoundId = "rbxassetid://719818409"
  101. Sound12.Volume = 2
  102. LocalScript13.Name = "ChristmasKatana_MainScript"
  103. LocalScript13.Parent = Tool0
  104. table.insert(cors,sandbox(LocalScript13,function()
  105. --local mDebugId = game.Workspace.DebugId.Value
  106. --game.Workspace.DebugId.Value = game.Workspace.DebugId.Value+1
  107. --print("Running swordscript <"..mDebugId..">")
  108. local debris = game:GetService("Debris")
  109.  
  110. -------------------------------------
  111. -- Makes an RBX::Lua Instance using
  112. -- a table of key-value pairs to
  113. -- initialize it. Values with numeric
  114. -- keys will be parented to the object
  115. -- and other values will be set
  116. -- as members of the object.
  117. function Create(ty)
  118. return function(data)
  119. local obj = Instance.new(ty)
  120. for k, v in pairs(data) do
  121. if type(k) == 'number' then
  122. v.Parent = obj
  123. else
  124. obj[k] = v
  125. end
  126. end
  127. return obj
  128. end
  129. end
  130.  
  131. ---------------------------------------
  132. -- Same as Make, but modifies an existing
  133. -- object rather than creating ones.
  134. function Modify(obj, data)
  135. for k, v in pairs(data) do
  136. if type(data) == 'number' then
  137. data.Parent = obj
  138. else
  139. data[k] = v
  140. end
  141. end
  142. return obj
  143. end
  144.  
  145. -----------------------------------------
  146. -- Creates a class which can be instantiated
  147. -- using `CreateCLASSNAME( ... )`.
  148. ---usage:
  149. --class'MyClass'(function(this, arg1)
  150. -- this.ClassMember = value
  151. -- function this.ClassMethod(...) ... end
  152. --end, function(def)
  153. -- def.StaticMember = value
  154. -- function def.StaticMethod(...) ... end
  155. --end)
  156. --local obj = CreateMyClass(arg1)
  157. ------------------------------------------
  158. local function class(name)
  159. local def = {}
  160. getfenv(0)[name] = def
  161. return function(ctor, static)
  162. local nctor = function(...)
  163. local this = {}
  164. if ctor then
  165. ctor(this, ...)
  166. end
  167. return this
  168. end
  169. getfenv(0)['Create'..name] = nctor
  170. if static then static(def) end
  171. end
  172. end
  173.  
  174.  
  175. ---------------------------------------------
  176. -- Signal class for custom-made events
  177. --API:
  178. -- Signal:connect(callback)
  179. -- Signal:fire(...)
  180. -- Signal:wait()
  181. ---------------------------------------------
  182. class'Signal'(function(this)
  183. local mListeners = {}
  184. local mWaitObject = Create'BoolValue'{}
  185.  
  186. function this:connect(func)
  187. local connection = {}
  188. function connection:disconnect()
  189. mListeners[func] = nil
  190. end
  191. mListeners[func] = connection
  192. return connection
  193. end
  194.  
  195. function this:fire(...)
  196. --print("Fire evt<"..tostring(this).."> from script<"..mDebugId..">")
  197. for func, conn in pairs(mListeners) do
  198. --print("-> "..tostring(func).."( ... )")
  199. func(...)
  200. end
  201. mWaitObject.Value = not mWaitObject.Value
  202. end
  203.  
  204. function this:wait()
  205. mWaitObject.Changed:wait()
  206. end
  207. end)
  208.  
  209.  
  210. --------------------------------------------------
  211. -- Bin class for cleaning up assets
  212. --API:
  213. -- Bin:add(func: Function, ident: String)
  214. -- Bin:clean(ident: String)
  215. -- Bin:cleanAll()
  216. --------------------------------------------------
  217. class'Bin'(function(this)
  218. local mGarbage = {}
  219.  
  220. function this:add(func, ident)
  221. ident = ident or '__unnamed'
  222. if not mGarbage[ident] then
  223. mGarbage[ident] = {}
  224. end
  225. mGarbage[ident][#mGarbage[ident]+1] = func
  226. end
  227.  
  228. function this:clean(ident)
  229. local listToCall = mGarbage[ident]
  230. if listToCall then
  231. for _, func in pairs(listToCall) do
  232. func()
  233. end
  234. mGarbage[ident] = nil
  235. end
  236. end
  237.  
  238. function this:cleanAll()
  239. for ident, list in pairs(mGarbage) do
  240. for _, func in pairs(list) do
  241. func()
  242. end
  243. mGarbage[ident] = nil
  244. end
  245. end
  246. end)
  247.  
  248.  
  249. -----------------------------------------------------
  250. -- AnimationProvider class for easy loading of
  251. -- animation assets into animationtracks once
  252. -- a humanoid is available.
  253. --API:
  254. -- AnimationProvider:registerAnimation(ident, assetid)
  255. -- AnimationProvider:setHumanoid(humanoid)
  256. -- AnimationProvider:setTool(tool)
  257. -- AnimationProvider:getAnimation(ident)
  258. -----------------------------------------------------
  259. class'AnimationProvider'(function(this)
  260. local mAnimations = {--[[ident => {AnimationId, CurrentTrack, CurrentAnim} ]]}
  261. local mCurrentHumanoid = nil
  262.  
  263. function this:registerAnimation(ident, assetid)
  264. --check for an existing copy of the anim
  265. local existingAnim = Tool.Tool:FindFirstChild('ANIM_'..ident)
  266.  
  267. --make the data for this anim
  268. local animdat = {
  269. AnimationId = assetid,
  270. CurrentAnim = existingAnim or Create'Animation'{
  271. Name = "ANIM_"..ident,
  272. AnimationId = assetid,
  273. },
  274. }
  275. mAnimations[ident] = animdat
  276.  
  277. --if there's a current tool, put it in there
  278. if Tool.Tool then
  279. Tool.HUGE_EQUIP_HACK = true
  280. animdat.CurrentAnim.Parent = Tool.Tool
  281. Tool.HUGE_EQUIP_HACK = false
  282. end
  283.  
  284. --if there's a humanoid load the animation track
  285. if mCurrentHumanoid then
  286. animdat.CurrentTrack = mCurrentHumanoid:LoadAnimation(animdat.CurrentAnim)
  287. end
  288. end
  289.  
  290. function this:setHumanoid(humanoid)
  291. mCurrentHumanoid = humanoid
  292. for _, anim in pairs(mAnimations) do
  293. anim.CurrentTrack = humanoid:LoadAnimation(anim.CurrentAnim)
  294. end
  295. end
  296.  
  297. function this:getAnimation(ident)
  298. local dat = mAnimations[ident]
  299. if not dat then error("Gear Fatal Error: Animation `"..ident.."` not found") end
  300. if not dat.CurrentTrack then
  301. error("Gear Fatal Error: No Humanoid for animation `"..ident.."` to run in")
  302. end
  303. return dat.CurrentTrack
  304. end
  305. end)
  306.  
  307.  
  308. ----------------------------------------------
  309. -- SoundProvider class
  310. -- functions similarily to the animationprovider
  311. ----------------------------------------------
  312. class'SoundProvider'(function(this)
  313. local mSounds = {}
  314.  
  315. function this:registerSound(ident, assetid, inpart)
  316. inpart = inpart or Tool.Tool:FindFirstChild('Handle')
  317. if not inpart then
  318. repeat
  319. inpart = Tool.Tool.ChildAdded:wait()
  320. until inpart.Name == 'Handle'
  321. end
  322. local existingSound = inpart:FindFirstChild('SOUND_'..ident)
  323. local sounddat = {
  324. SoundId = assetid,
  325. CurrentSound = existingSound or Create'Sound'{
  326. Name = 'SOUND_'..ident,
  327. SoundId = assetid,
  328. Parent = inpart,
  329. },
  330. }
  331. mSounds[ident] = sounddat
  332. end
  333.  
  334. function this:getSound(ident)
  335. local dat = mSounds[ident]
  336. if dat then
  337. return dat.CurrentSound
  338. end
  339. end
  340. end)
  341.  
  342.  
  343. ----------------------------------------------
  344. -- DebounceProvider class -- Prevent events
  345. -- from happening in too rapid succession
  346. ----------------------------------------------
  347. class'DebounceProvider'(function(this)
  348. local mFlagNameToLastTime = {}
  349.  
  350. function this:test(ident, delta)
  351. local t = tick()
  352. local lastTime = mFlagNameToLastTime[ident] or 0
  353. if delta then
  354. return (t-lastTime) > delta
  355. else
  356. return mFlagNameToLastTime[ident]
  357. end
  358. end
  359. function this:set(ident, state)
  360. if state then
  361. mFlagNameToLastTime[ident] = state
  362. elseif state == false then
  363. mFlagNameToLastTime[ident] = false
  364. else
  365. mFlagNameToLastTime[ident] = tick()
  366. end
  367. end
  368. end)
  369.  
  370.  
  371. function TagHumanoid(humanoid)
  372. if Tool.Player then
  373. local tag = Create'ObjectValue'{
  374. Name = "creator",
  375. Value = Tool.Player,
  376. Parent = humanoid,
  377. }
  378. Tool.Bin:add(function()
  379. tag:Remove()
  380. end, 'HumanoidTag')
  381. end
  382. end
  383. function UntagHumanoid()
  384. Tool.Bin:clean('HumanoidTag')
  385. end
  386.  
  387.  
  388. ------- wait for any event in a set of events to fire ------
  389. function WaitForAny(tb)
  390. local evt = tb
  391. local conn = {}
  392. local eventargs = nil
  393. local waitProxy = Create'BoolValue'{}
  394. for _, e in pairs(evt) do
  395. local c = e:connect(function(...)
  396. for _, c in pairs(conn) do
  397. c:disconnect()
  398. end
  399. eventargs = {...}
  400. waitProxy.Value = not waitProxy.Value
  401. end)
  402. conn[#conn+1] = c
  403. end
  404. --
  405. waitProxy.Changed:wait()
  406. --
  407. return unpack(eventargs)
  408. end
  409.  
  410.  
  411. ----------------------------------------------
  412. -- Tool singleton class
  413. --API:
  414. -- ...
  415. class'Tool'(nil, function(this)
  416. --need this here for the animationprovider to use
  417. this.HUGE_EQUIP_HACK = false
  418.  
  419. this.Bin = CreateBin()
  420. this.AnimationProvider = CreateAnimationProvider()
  421. this.DebounceProvider = CreateDebounceProvider()
  422. this.SoundProvider = CreateSoundProvider()
  423.  
  424. --general values
  425. this.Tool = script.Parent
  426. this.Player = nil
  427. this.Humanoid = nil
  428. this.Character = nil
  429.  
  430. --============ several flags for the gear
  431. --nothing
  432.  
  433. --some events
  434. this.Equipped = CreateSignal()
  435. this.Unequipped = CreateSignal()
  436. this.OwnerChange = CreateSignal()
  437.  
  438. --mouse utility events
  439. this.MouseClick = CreateSignal()
  440. this.MouseDoubleClick = CreateSignal()
  441. this.DoubleClickThreshold = 0.2
  442.  
  443. local mLastClickTime = 0
  444.  
  445. script.Parent.Equipped:connect(function(mouse)
  446. --print("Internal Equipped: Time b: "..time())
  447. --set up general values in the tool
  448. this.Mouse = mouse
  449. local curOwner = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
  450. if curOwner ~= this.Player then
  451. this.Player = curOwner
  452. this.OwnerChange:fire(this.Player)
  453. end
  454. this.Character = this.Player.Character
  455. this.Humanoid = this.Character.Humanoid
  456. this.AnimationProvider:setHumanoid(this.Humanoid)
  457.  
  458. --set up the mouse events
  459. mouse.Button1Down:connect(function()
  460. local t = tick()
  461. if (t-mLastClickTime) < this.DoubleClickThreshold then
  462. --prvent multiple double-clicks in a row
  463. mLastClickTime = 0
  464. this.MouseDoubleClick:fire(mouse)
  465. else
  466. mLastClickTime = t
  467. this.MouseClick:fire(mouse)
  468. end
  469. end)
  470.  
  471. --done setup, call the equipped function
  472. if this.HUGE_EQUIP_HACK then
  473. --the HUGE_EQUIP_HACK flags tells the tool that the equip is a synchronous
  474. --call as a result of parenting an animation to the character, which happens
  475. --when the tool is picked up from the workspace, but not during normal equips
  476. --(Why does this happen???), if this is the case, the call should be rederrred
  477. --one tick to ensure that all of the gear's loading can complete before it's
  478. --equipped event is called.
  479. --TODO: Blame John for this.
  480. Delay(0, function()
  481. this.Equipped:fire(mouse)
  482. end)
  483. else
  484. --otherwise, proceed as normal
  485. this.Equipped:fire(mouse)
  486. end
  487. end)
  488.  
  489. script.Parent.Unequipped:connect(function()
  490. --before my teardown, fire the event
  491. this.Unequipped:fire()
  492.  
  493. --delete all my garbage
  494. this.Bin:cleanAll()
  495. end)
  496. end)
  497.  
  498.  
  499.  
  500. ---------------------------------------------------------------------------------------------------
  501. ---------------------------------------------------------------------------------------------------
  502. ---------------------------------------------------------------------------------------------------
  503. -- --
  504. -- Specific Gear code starts Here --
  505. -- --
  506. ---------------------------------------------------------------------------------------------------
  507. ---------------------------------------------------------------------------------------------------
  508. ---------------------------------------------------------------------------------------------------
  509.  
  510. --register my stuff
  511. Tool.AnimationProvider:registerAnimation('equip', 'http://www.roblox.com/asset/?id=66702743')
  512. Tool.AnimationProvider:registerAnimation('slash', 'http://www.roblox.com/asset/?id=66702758')
  513. Tool.AnimationProvider:registerAnimation('critup', 'http://www.roblox.com/asset/?id=66703957')
  514. Tool.AnimationProvider:registerAnimation('critdown', 'http://www.roblox.com/asset/?id=66703954')
  515. Tool.SoundProvider:registerSound('slash', 'rbxasset://sounds\\swordslash.wav')
  516. Tool.SoundProvider:registerSound('equip', 'rbxasset://sounds\\unsheath.wav')
  517. Tool.SoundProvider:registerSound('down', 'rbxasset://sounds\\swordlunge.wav')
  518. Tool.SoundProvider:registerSound('hitground', 'rbxasset://sounds\\snap.wav')
  519.  
  520. local DamageEnbled = false
  521. local DamageToDo = 20
  522. local SparkleParts = {}
  523. local SparkleAttach = {}
  524.  
  525. Tool.Equipped:connect(function()
  526. print("Equipped")
  527. Tool.AnimationProvider:getAnimation('equip'):Play(0, 1, 3)
  528. Tool.SoundProvider:getSound('equip'):Play()
  529. local handleTouchedConn = Tool.Tool.Handle.Touched:connect(function(part)
  530. local h = (part.Parent or game):FindFirstChild("Humanoid")
  531. if DamageEnbled and h then
  532. TagHumanoid(h)
  533. h:TakeDamage(DamageToDo)
  534. wait(1)
  535. UntagHumanoid()
  536. end
  537. end)
  538. Tool.Bin:add(function()
  539. handleTouchedConn:disconnect()
  540. end, 'disconnect_handle_ontouched')
  541.  
  542. local color = true
  543. for i = -3, 3, 1.5 do
  544. color = not color
  545. local p = Create'Part'{
  546. Name = 'EffectPart',
  547. FormFactor = 'Custom',
  548. Size = Vector3.new(0.1, 0.1, 0.1),
  549. Parent = Tool.Tool.Handle,
  550. Transparency = 1,
  551. CanCollide = false,
  552. Create'Fire'{
  553. Name = 'Effect',
  554. Enabled = false,
  555. Color = (color and Color3.new(1, 0, 0) or Color3.new(1, 1, 1)),
  556. Size = 2,
  557. },
  558. }
  559. --[[SparkleParts[#SparkleParts+1] = p
  560. local motor = Create'Motor6D'{
  561. Name = 'EffectAttach',
  562. Parent = Tool.Tool.Handle,
  563. Part0 = Tool.Tool.Handle,
  564. Part1 = p,
  565. C1 = CFrame.new(i, 0, 0),
  566. }
  567. SparkleAttach[#SparkleAttach+1] = motor]]
  568. end
  569. Tool.Bin:add(function()
  570. for _, effectPart in pairs(SparkleParts) do
  571. effectPart.Parent = nil
  572. end
  573. for _, p in pairs(SparkleAttach) do
  574. p.Parent = nil
  575. end
  576. SparkleParts = {}
  577. SparkleAttach = {}
  578. end, 'kill_particle_effect')
  579. end)
  580.  
  581. Tool.Unequipped:connect(function()
  582. Tool.AnimationProvider:getAnimation('equip'):Stop()
  583. end)
  584.  
  585. --utility to enable / disable damage. Makes sure that enable-disable
  586. --pairs don't ever interfear with one and other.
  587. local damageEnabledLevel = 0
  588. local function EnableDamage(damage)
  589. DamageEnbled = true
  590. DamageToDo = damage
  591. damageEnabledLevel = damageEnabledLevel + 1
  592. end
  593. local function DisableDamage()
  594. damageEnabledLevel = damageEnabledLevel - 1
  595. if damageEnabledLevel <= 0 then
  596. DamageEnbled = false
  597. end
  598. end
  599.  
  600.  
  601. --set particles enabled
  602. local function SetBladeEffectEnabled(state)
  603. for _, effectPart in pairs(SparkleParts) do
  604. effectPart.Effect.Enabled = state
  605. end
  606. end
  607.  
  608. local function frand(low, high)
  609. return low + math.random()*(high-low)
  610. end
  611.  
  612. --local blues = {23,107,102,11,45,135}
  613. local blues = {5, 24, 1009, 105, 1017}
  614. function allThatIce(pos, isTurbo)
  615. local count = 5
  616. if (isTurbo == true) then count = 10 end
  617.  
  618. for i=1,count do
  619. local p = Instance.new("Part")
  620. p.BrickColor = BrickColor.new(blues[math.random(#blues)])
  621. p.formFactor = 2
  622. p.Size = Vector3.new(1,.4,1)
  623. p.Material = Enum.Material.Ice
  624. p.TopSurface = 0
  625. p.BottomSurface = 0
  626.  
  627. local a = math.random() * 6.28
  628. local d = Vector3.new(math.cos(a), 0, math.sin(a)).unit
  629. p.Velocity = d * 25
  630. p.RotVelocity = d
  631. p.Position = pos + Vector3.new(0, math.random() * 3, 0) + (d * 2)
  632. p.Parent = game.Workspace
  633.  
  634. debris:AddItem(p, 4)
  635. end
  636.  
  637. end
  638.  
  639. --make the hitting ground effect
  640. local PossibleSplashColors = {Color3.new(1, 0, 0), Color3.new(.5, 0, 0)}
  641. local function CreateSplashEffect(pos)
  642. local splashParts = {}
  643. for i = 1, 20 do
  644. local part = Create'Part'{
  645. FormFactor = 'Custom',
  646. Name = 'SlashParticle',
  647. Transparency = 1,
  648. CanCollide = false,
  649. Size = Vector3.new(0.5, 0.5, 0.5),
  650. CFrame = CFrame.new(pos),
  651. Create'Fire'{
  652. Name = 'Effect',
  653. Size = 2,
  654. Color = PossibleSplashColors[math.random(1, #PossibleSplashColors)],
  655. },
  656. Create'BodyVelocity'{
  657. Name = 'Fly',
  658. P = 100000,
  659. maxForce = Vector3.new(0, 0, 0),
  660. velocity = Vector3.new(frand(-1, 1),
  661. frand(0.5,1),
  662. frand(-1, 1)).unit * frand(20, 80),
  663. },
  664. }
  665. splashParts[#splashParts+1] = part
  666. part.Parent = game.Workspace
  667. part.Velocity = part.Fly.velocity
  668. Delay(frand(0.5, 2), function()
  669. part.Parent = nil
  670. end)
  671. end
  672. Tool.Bin:add(function()
  673. for _, p in pairs(splashParts) do
  674. p.Parent = nil
  675. end
  676. end, 'remove_splash_effect')
  677. end
  678.  
  679. --====== main action code
  680.  
  681. Tool.MouseClick:connect(function()
  682. if Tool.DebounceProvider:test('slash', 0.5) then
  683. Tool.DebounceProvider:set('slash')
  684. Tool.AnimationProvider:getAnimation('slash'):Play(0, 1, 4)
  685. Tool.SoundProvider:getSound('slash'):Play()
  686. EnableDamage(20)
  687. wait(0.7)
  688. DisableDamage()
  689. end
  690. end)
  691.  
  692. Tool.MouseDoubleClick:connect(function()
  693. if not Tool.DebounceProvider:test('doubleclick') then
  694. Tool.DebounceProvider:set('doubleclick', true)
  695. --
  696. Tool.AnimationProvider:getAnimation('slash'):Stop(0)
  697. Tool.AnimationProvider:getAnimation('critup'):Play(0, 1, 8)
  698. local torso = Tool.Character:FindFirstChild("Torso")
  699. if torso then
  700. --jump high
  701. Tool.Humanoid.Jump = true
  702. torso.Velocity = torso.Velocity + Vector3.new(0, 120, 0)-- + (torso.CFrame.lookVector * 150)
  703. local bv = Instance.new("BodyAngularVelocity")
  704. bv.P = 1250
  705. local mmm = torso.CFrame.lookVector
  706. bv.angularvelocity = Vector3.new(mmm.z, 0, -mmm.x) * 8 --Vector3.new(0,0,0)
  707. bv.maxTorque = Vector3.new(400000,400000,400000)
  708. bv.Parent = torso
  709.  
  710. --wait for the character to reach the top of their jump
  711. while torso.Velocity.y > 0.1 do
  712. wait()
  713. end
  714.  
  715. bv:Remove()
  716.  
  717. --[[
  718. local pos = torso.Position
  719.  
  720. for i, v in pairs(Workspace:GetChildren()) do
  721. local h = v:FindFirstChild("Humanoid")
  722. if h and h ~= Tool.Character.Humanoid then
  723. local t = v:FindFirstChild("Torso")
  724. if t then
  725. if (t.Position - pos).magnitude <= 15 then
  726. h.Sit = true
  727. h.Parent.Torso.Velocity = (CFrame.new(script.Parent.Handle.Position, h.Parent.Torso.Position).lookVector * 200) + Vector3.new(0, 100, 0)
  728. h.Parent.Torso.RotVelocity = Vector3.new(math.random(-100, 100), math.random(-100, 100), math.random(-100, 100))
  729. end
  730. end
  731. end
  732. end]]
  733.  
  734.  
  735. --now, switch to the critdown anim / sound, activate the damage,
  736. --and wait for the player to hit something on their way down.
  737. --also, speed up their descent
  738. EnableDamage(40)
  739. Tool.AnimationProvider:getAnimation('critup'):Stop(0)
  740. Tool.AnimationProvider:getAnimation('critdown'):Play(0, 1, 10)
  741. Tool.SoundProvider:getSound('down'):Play()
  742. torso.Velocity = torso.Velocity - Vector3.new(0, 10, 0)
  743.  
  744. SetBladeEffectEnabled(true) --show some particles on the way down
  745.  
  746. local rightLeg = Tool.Character:FindFirstChild('Right Leg')
  747. local leftLeg = Tool.Character:FindFirstChild('Left Leg')
  748. WaitForAny{rightLeg.Touched, leftLeg.Touched}
  749.  
  750. SetBladeEffectEnabled(false) --get rid of the particles, we've leanded
  751.  
  752. --play the hit gound sound
  753. Tool.SoundProvider:getSound('hitground'):Play()
  754.  
  755. --generate a splash effect where the collision occurred
  756. local handle = Tool.Tool:FindFirstChild('Handle')
  757. if handle then
  758. --CreateSplashEffect((handle.CFrame*CFrame.new(2.5, 0, 0)).p)
  759. allThatIce((handle.CFrame*CFrame.new(2.5,0,0)).p, true)
  760. end
  761.  
  762. --now, we touched down, so halt the player for a cooldown, and
  763. --wait a bit for the cooldown to expire
  764. Tool.Humanoid.WalkSpeed = 0
  765. wait(0.175)
  766.  
  767. --unfreeze them and stop the anim, also, disable the damage
  768. Tool.Humanoid.WalkSpeed = 16
  769. Tool.AnimationProvider:getAnimation('critdown'):Stop()
  770. DisableDamage()
  771. else
  772. --no torso? Something is wrong, stop the anim
  773. Tool.AnimationProvider:getAnimation('critup'):Stop(0)
  774. end
  775. --
  776. Tool.DebounceProvider:set('doubleclick', false)
  777. end
  778. end)
  779.  
  780. --print("Done Running swordscript <"..mDebugId..">")
  781. end))
  782. Script14.Name = "MotorizeRightGrip"
  783. Script14.Parent = LocalScript13
  784. table.insert(cors,sandbox(Script14,function()
  785. function Create(ty)
  786. return function(data)
  787. local obj = Instance.new(ty)
  788. for k, v in pairs(data) do
  789. if type(k) == 'number' then
  790. v.Parent = obj
  791. else
  792. obj[k] = v
  793. end
  794. end
  795. return obj
  796. end
  797. end
  798.  
  799. local Tool = script.Parent.Parent
  800.  
  801. local armChildRemovedConn = nil
  802. local Motor6DGrip = nil
  803. local EquippedNum = 0
  804.  
  805. Tool.Equipped:connect(function()
  806. EquippedNum = EquippedNum + 1
  807. local myEquip = EquippedNum
  808. --some vars
  809. local Player = game.Players:GetPlayerFromCharacter(Tool.Parent)
  810. local Character = Player.Character
  811.  
  812. local rightarm = Character:FindFirstChild('Right Arm')
  813. if rightarm and rightarm:FindFirstChild('RightGrip') then
  814. local rightGrip = rightarm['RightGrip']
  815. local handle = rightGrip.Part1
  816.  
  817. --kill my joint when the normal joint is removed
  818. --this must be done here so that the joint is removed
  819. --_right away_ after unequipping and the character doesn't
  820. --glitch up.
  821. local armChildRemovedConn = rightarm.ChildRemoved:connect(function(ch)
  822. if ch == rightGrip then
  823. Motor6DGrip:Remove()
  824. Motor6DGrip = nil
  825. --
  826. if handle and Character:FindFirstChild('Torso') then
  827. if Tool.Parent.Parent:IsA('Player') then
  828. --the sword has been deselected
  829. --put the sword far away so the user doesn't notice that the handle doesn't
  830. --update for about 0.1 seconds after selecting the tool.
  831. handle.CFrame = CFrame.new(100000, 100000, 100000)
  832. else
  833. --if in the workspace, position the handle where it should be dropped
  834. --use the size of the handle to make sure it's dropped far enough away
  835. handle.CFrame = Character.Torso.CFrame * CFrame.new(0, 0, -(handle.Size.magnitude+2))
  836. end
  837. end
  838. end
  839. end)
  840.  
  841. --make my new joint
  842. Motor6DGrip = Create'Motor6D'{
  843. Name = 'RightGrip_Motor',
  844. Part0 = rightarm,
  845. Part1 = handle,
  846. }
  847. --kill the old weld
  848. rightGrip.Part1 = nil
  849. rightGrip.Part0 = nil
  850. Motor6DGrip.Parent = rightGrip.Parent
  851. Motor6DGrip.C1 = Motor6DGrip.C1 * CFrame.Angles(0, -math.pi/2, 0)
  852. Motor6DGrip.C1 = Motor6DGrip.C1 * CFrame.Angles(math.pi/2, 0, 0)
  853. Motor6DGrip.C1 = Motor6DGrip.C1 + Vector3.new(0.20, 0, 0)
  854. end
  855. end)
  856.  
  857. Tool.Unequipped:connect(function()
  858. EquippedNum = EquippedNum + 1
  859. if armChildRemovedConn then
  860. armChildRemovedConn:disconnect()
  861. armChildRemovedConn = nil
  862. end
  863. end)
  864.  
  865. end))
  866. Animation15.Name = "ANIM_equip"
  867. Animation15.Parent = Tool0
  868. Animation15.AnimationId = "rbxassetid://4047725350"
  869. Animation16.Name = "ANIM_slash"
  870. Animation16.Parent = Tool0
  871. Animation16.AnimationId = "rbxassetid://4059144400"
  872. Animation17.Name = "ANIM_critup"
  873. Animation17.Parent = Tool0
  874. Animation17.AnimationId = "rbxassetid://4047725350"
  875. Animation18.Name = "ANIM_critdown"
  876. Animation18.Parent = Tool0
  877. Animation18.AnimationId = "rbxassetid://4047725350"
  878. LocalScript19.Name = "SpinScr"
  879. LocalScript19.Parent = Tool0
  880. table.insert(cors,sandbox(LocalScript19,function()
  881. on = 0
  882. Tool = script.Parent
  883. torso = nil
  884. human = nil
  885.  
  886. bv = Instance.new("BodyAngularVelocity")
  887. bv.P = 1250
  888. bv.angularvelocity = Vector3.new(0,26,0)
  889. bv.maxTorque = Vector3.new(0,400000,0)
  890.  
  891. function Crouch(ison)
  892. if torso == nil then
  893. torso = Tool.Parent:FindFirstChild("Torso")
  894. end
  895. if human == nil then
  896. human = Tool.Parent:FindFirstChild("Humanoid")
  897. end
  898.  
  899. if ison == 0 then
  900. while torso:FindFirstChild("BodyAngularVelocity") do
  901. torso:FindFirstChild("BodyAngularVelocity"):Remove()
  902. end
  903. human.WalkSpeed = 16
  904. elseif ison == 1 then
  905. newf = bv:Clone()
  906. newf.Parent = torso
  907. newf.archivable = false
  908. human.WalkSpeed = 32
  909. end
  910. end
  911.  
  912. function Key(key)
  913. if key then
  914. key = string.lower(key)
  915. if (key=="x") then --SPIN TIME!
  916. print("X key pressed")
  917. if on == 1 then
  918. on = 0
  919. elseif on == 0 then
  920. on = 1
  921. end
  922. Crouch(on)
  923. end
  924. end
  925. end
  926.  
  927. function Equip(mouse)
  928. mouse.KeyDown:connect(Key)
  929. end
  930. function Unequip()
  931. print("Unequipping!")
  932. while torso:FindFirstChild("BodyAngularVelocity") do
  933. torso:FindFirstChild("BodyAngularVelocity"):Remove()
  934. end
  935. human.WalkSpeed = 16
  936. end
  937. script.Parent.Equipped:connect(Equip)
  938. script.Parent.Unequipped:connect(Unequip)
  939. end))
  940. Script20.Parent = Tool0
  941. table.insert(cors,sandbox(Script20,function()
  942. print ("VIP Shirt Door Script Loaded")
  943.  
  944. -- list of account names allowed to go through the door.
  945. permission = { "robloxowns1" , "cooldog0204" , "http://www.roblox.com/Fight-On-A-Nintendo-3DS-VIP-item?id=94383317" } -- This is how many people can still get through, so u don't have to change shirts. You can also have another friend here.
  946.  
  947. -- TextureId of the VIP shirt.
  948. texture = "http://www.roblox.com/Fight-On-A-Nintendo-3DS-VIP-item?id=94383317" -- Go to the wiki below this script to find out how to change the shirt. And paste the link in between the "" marks.
  949.  
  950. function checkOkToLetIn(name)
  951. for i = 1,#permission do
  952. -- convert strings to all upper case, otherwise we will let in
  953. -- "Username" but not "username" or "uSERNAME"
  954. if (string.upper(name) == string.upper(permission[i])) then return true end
  955. end
  956. return false
  957. end
  958.  
  959. local Door = script.Parent
  960.  
  961. function onTouched(hit)
  962. print("Door Hit")
  963. local human = hit.Parent:findFirstChild("Humanoid")
  964. if (human ~= nil ) then
  965. if human.Parent.Torso.roblox.Texture == texture then --the shirt
  966. Door.Transparency = 0.7
  967. Door.CanCollide = false
  968. wait(4) -- this is how long the door is open
  969. Door.CanCollide = true
  970. Door.Transparency = 0
  971. -- a human has touched this door!
  972. print("Human touched door")
  973. -- test the human's name against the permission list
  974. elseif (checkOkToLetIn(human.Parent.Name)) then
  975. print("Human passed test")
  976. Door.Transparency = 0.7
  977. Door.CanCollide = false
  978. wait(4) -- this is how long the door is open
  979. Door.CanCollide = true
  980. Door.Transparency = 0
  981. else human.Health = 0 -- delete this line of you want a non-killing VIP door
  982. end
  983. end
  984. end
  985.  
  986. script.Parent.Touched:connect(onTouched)
  987.  
  988.  
  989.  
  990. end))
  991. for i,v in pairs(mas:GetChildren()) do
  992. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  993. pcall(function() v:MakeJoints() end)
  994. end
  995. mas:Destroy()
  996. for i,v in pairs(cors) do
  997. spawn(function()
  998. pcall(v)
  999. end)
  1000. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement