DustyThomas

Susanoo

May 30th, 2016
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. local skateboardId = 92837366 --ID of the item or model (It summons a Ninja Guard)
  2.  
  3. local Tool = script.Parent;
  4.  
  5.  
  6. function insert()
  7.  
  8. --This call will cause a "wait" until the data comes back
  9. local root = game:GetService("InsertService"):LoadAsset(skateboardId)
  10.  
  11.  
  12. local instances = root:GetChildren()
  13. if #instances == 0 then
  14. root:Remove()
  15. return
  16. end
  17.  
  18. --Continue the insert process
  19. root.Name = "InsertedObject" .. skateboardId
  20.  
  21. game:GetService("InsertService"):Insert(root)
  22.  
  23. local t = game.Players.LocalPlayer.Character:FindFirstChild("Torso")
  24.  
  25. root:MoveTo(t.Position + t.CFrame.lookVector * 8)
  26.  
  27. Tool.Handle.Drop:Play()
  28.  
  29. end
  30.  
  31.  
  32.  
  33. enabled = true
  34. function onButton1Down(mouse)
  35. if not enabled then
  36. return
  37. end
  38.  
  39. enabled = false
  40.  
  41.  
  42. insert()
  43. wait(.01)
  44.  
  45. Tool:Remove()
  46.  
  47.  
  48. end
  49.  
  50. function onEquippedLocal(mouse)
  51.  
  52. if mouse == nil then
  53. print("Mouse not found")
  54. return
  55. end
  56.  
  57. mouse.Icon = "http://www.roblox.com/asset/?id=24656966"
  58. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  59. end
  60.  
  61.  
  62. Tool.Equipped:connect(onEquippedLocal)
  63.  
  64. --Orginally Roblox created that script for Skateboards,I just Discovered how to spawn another thing... -Dawgra
Add Comment
Please, Sign In to add comment