Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. me = game.Players.MyNameIs1222
  2. char = me.Character
  3. hoppa = Instance.new("HopperBin")
  4. hoppa.Parent = me.Backpack
  5. hoppa.Name = "Tool creator"
  6. script.Parent = hoppa
  7. function selected(mouse, key)
  8. mouse.Button1Down:connect(function()
  9. if mouse.Target then
  10. local targ = mouse.Target
  11. if targ.Name == "Base" then return end
  12. local too = Instance.new("Tool")
  13. too.Parent = me.Backpack
  14. too.Name = targ.Name
  15. too.GripPos = Vector3.new(0,0,0)
  16. if targ.Size.Y >= 1 then
  17. too.GripPos = Vector3.new(0,-0.5,0)
  18. elseif targ.Size.Y >= 2 then
  19. too.GripPos = Vector3.new(0,-1,0)
  20. elseif targ.Size.Y >= 3 then
  21. too.GripPos = Vector3.new(0,-1.5,0)
  22. elseif targ.Size.Y >= 4 then
  23. too.GripPos = Vector3.new(0,-2,0)
  24. end
  25. local hand = targ
  26. hand.Name = "Handle"
  27. hand.Anchored = false
  28. hand.Parent = too
  29. hand.CanCollide = false
  30. local gee = false
  31. local function touch(hit)
  32. if gee == false then return end
  33. local hum = hit.Parent:findFirstChild("Humanoid")
  34. if hum ~= nil then
  35. hum:TakeDamage(math.random(5,10))
  36. end
  37. end
  38. hand.Touched:connect(touch)
  39. too.Equipped:connect(function()
  40. too.Activated:connect(function()
  41. gee = true
  42. local val = Instance.new("StringValue")
  43. val.Parent = too
  44. val.Name = "toolanim"
  45. val.Value = "Slash"
  46. wait(0.5)
  47. gee = false
  48. end)
  49. end)
  50. end
  51. end)
  52. end
  53. script.Parent.Selected:connect(selected)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement