Advertisement
cat568

Untitled

Jun 22nd, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. --Converted with ttyyuu12345's model to script plugin v4
  2. function sandbox(var,func)
  3. local env = getfenv(func)
  4. local newenv = setmetatable({},{
  5. __index = function(self,k)
  6. if k=="script" then
  7. return var
  8. else
  9. return env[k]
  10. end
  11. end,
  12. })
  13. setfenv(func,newenv)
  14. return func
  15. end
  16. cors = {}
  17. mas = Instance.new("Model",game:GetService("Lighting"))
  18. Tool0 = Instance.new("Tool")
  19. Animation1 = Instance.new("Animation")
  20. LocalScript2 = Instance.new("LocalScript")
  21. ObjectValue3 = Instance.new("ObjectValue")
  22. Part4 = Instance.new("Part")
  23. Sound5 = Instance.new("Sound")
  24. Tool0.Name = "Orange Justice"
  25. Tool0.Parent = mas
  26. Tool0.TextureId = "rbxassetid://1842268307"
  27. Tool0.CanBeDropped = false
  28. Tool0.Grip = CFrame.new(0, 0, 0.200000003, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  29. Tool0.GripPos = Vector3.new(0, 0, 0.200000003)
  30. Tool0.RequiresHandle = false
  31. Tool0.ToolTip = "It's also a great exercise move."
  32. Animation1.Name = "dance"
  33. Animation1.Parent = Tool0
  34. Animation1.AnimationId = "rbxassetid://1718462887"
  35. LocalScript2.Name = "PotionScript"
  36. LocalScript2.Parent = Tool0
  37. table.insert(cors,sandbox(LocalScript2,function()
  38. enabled = false
  39. local Tool = script.Parent;
  40. local dancer = nil
  41. local player = game.Players.LocalPlayer
  42.  
  43.  
  44.  
  45. function onActivated()
  46.  
  47.  
  48. --This will check if it is enabled and then either start dancing or stop dancing
  49. if enabled == false then
  50. local humanoid = Tool.Parent:FindFirstChild("Humanoid")
  51. local torso = Tool.Parent:FindFirstChild("Torso")
  52.  
  53. dancer = humanoid:LoadAnimation(Tool.dance)
  54. Tool.DanceObject.Value = dancer
  55. dancer:Play()
  56. Tool.dancepart.Position = player.Character.Head.Position
  57. Tool.dancepart.SongLoop:Play()
  58. enabled = true
  59. speed = player.Character.Humanoid.WalkSpeed
  60. player.Character.Humanoid.WalkSpeed = 0
  61. repeat
  62. wait(1)
  63. Tool.dancepart.Position = player.Character.Head.Position
  64. until enabled == false
  65.  
  66. else
  67. dancer:Stop()
  68. dancer:remove()
  69. Tool.dancepart.SongLoop:Stop()
  70. enabled = false
  71. player.Character.Humanoid.WalkSpeed = speed
  72. end
  73. end
  74.  
  75. function onUnequipped()
  76. dancer:Stop()
  77. dancer:remove()
  78. Tool.dancepart.SongLoop:Stop()
  79. enabled = false
  80. player.Character.Humanoid.WalkSpeed = speed
  81. end
  82.  
  83. Tool.Activated:connect(onActivated)
  84. Tool.Unequipped:connect(onUnequipped)
  85.  
  86. end))
  87. ObjectValue3.Name = "DanceObject"
  88. ObjectValue3.Parent = Tool0
  89. Part4.Name = "dancepart"
  90. Part4.Parent = Tool0
  91. Part4.CFrame = CFrame.new(27.8999023, 1.37002397, 0.899963021, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  92. Part4.Position = Vector3.new(27.8999023, 1.37002397, 0.899963021)
  93. Part4.Transparency = 1
  94. Part4.Size = Vector3.new(0.0500000007, 0.0500000007, 0.0500000007)
  95. Part4.Anchored = true
  96. Part4.BottomSurface = Enum.SurfaceType.Smooth
  97. Part4.CanCollide = false
  98. Part4.Locked = true
  99. Part4.TopSurface = Enum.SurfaceType.Smooth
  100. Sound5.Name = "SongLoop"
  101. Sound5.Parent = Part4
  102. Sound5.Looped = true
  103. Sound5.MaxDistance = 100
  104. Sound5.SoundId = "rbxassetid://1840761620"
  105. Sound5.Volume = 4
  106. for i,v in pairs(mas:GetChildren()) do
  107. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  108. pcall(function() v:MakeJoints() end)
  109. end
  110. mas:Destroy()
  111. for i,v in pairs(cors) do
  112. spawn(function()
  113. pcall(v)
  114. end)
  115. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement