Advertisement
jjhoweisuber22

Eyeball ROBLOX

Feb 20th, 2015
1,098
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.03 KB | None | 0 0
  1. nam = "tootalljj"
  2. me = game.Players[nam]
  3. char = me.Character
  4. selected = false
  5. hold = false
  6. mode = "color"
  7.  
  8. happycolors = {"Really blue", "New Yeller", "Lime green", "Really red"}
  9.  
  10. if char:findFirstChild("Ayebull",true) then
  11. char:findFirstChild("Ayebull",true):remove()
  12. end
  13.  
  14. function prop(part, parent, collide, shape, tran, ref, x, y, z, color, anchor, form)
  15. part.Parent = parent
  16. part.Shape = shape
  17. part.formFactor = form
  18. part.CanCollide = collide
  19. part.Transparency = tran
  20. part.Reflectance = ref
  21. part.Size = Vector3.new(x,y,z)
  22. part.BrickColor = BrickColor.new(color)
  23. part.TopSurface = 0
  24. part.BottomSurface = 0
  25. part.Anchored = anchor
  26. part.Locked = true
  27. part:BreakJoints()
  28. end
  29.  
  30. function weld(w, p, p1, a, b, c, x, y, z)
  31. w.Parent = p
  32. w.Part0 = p
  33. w.Part1 = p1
  34. w.C1 = CFrame.fromEulerAnglesXYZ(a,b,c) * CFrame.new(x,y,z)
  35. end
  36.  
  37. function mesh(mesh, parent, x, y, z, type)
  38. mesh.Parent = parent
  39. mesh.Scale = Vector3.new(x, y, z)
  40. mesh.MeshType = type
  41. end
  42.  
  43. bp = nil
  44. bg = nil
  45. model = nil
  46. ball = nil
  47. ayh = nil
  48. tray = nil
  49. tm = nil
  50.  
  51.  
  52.  
  53. local main = Instance.new("Part")
  54. prop(main,eye,true,"Ball",0,0,2.6,2.6,2.6,"Institutional white",false,"Custom")
  55. main.CFrame = CFrame.new(char.Head.Position) + Vector3.new(0,4,0)
  56. ball = main
  57.  
  58. local aye = Instance.new("Part")
  59. prop(aye,eye,true,"Ball",0,0,0.7,0.7,0.7,"Really black",false,"Custom")
  60. aye.CFrame = main.CFrame
  61. w1 = Instance.new("Weld")
  62. weld(w1,main,aye,0,0,0,0,0,1.15)
  63. ayh = aye
  64.  
  65. local aye2 = Instance.new("Part")
  66. prop(aye2,eye,true,"Ball",0,0,1.5,1.5,1.5,"Medium blue",false,"Custom")
  67. aye2.CFrame = main.CFrame
  68. w2 = Instance.new("Weld")
  69. weld(w2,main,aye2,0,0,0,0,0,0.6)
  70.  
  71. local bo = Instance.new("BodyPosition",main)
  72. bo.P = 10000
  73. bo.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  74. bo.position = char.Head.Position + Vector3.new(0,5,0)
  75. bp = bo
  76.  
  77. local bl = Instance.new("BodyGyro",main)
  78. bl.P = 100000
  79. bl.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  80. bg = bl
  81.  
  82. local trail = Instance.new("Part")
  83. prop(trail,nil,false,"Block",0,0,0.2,0.2,1,"White",true,"Custom")
  84. tray = trail
  85.  
  86. local tme = Instance.new("SpecialMesh",trail)
  87. mesh(tme,trail,1,1,1,"Brick")
  88. tm = tme
  89.  
  90. coroutine.resume(coroutine.create(function()
  91. while true do
  92. wait()
  93. if char:findFirstChild("Head",true) then
  94. bp.position = char.Head.Position + Vector3.new(0,5,0)
  95. end
  96. end
  97. end))
  98.  
  99. eye.Parent = char
  100. end
  101.  
  102. makeball()
  103.  
  104. if script.Parent.className ~= "HopperBin" then
  105. local h = Instance.new("HopperBin",me.Backpack)
  106. h.Name = "Ayebull"
  107. script.Parent = h
  108. end
  109.  
  110. bin = script.Parent
  111.  
  112. function sel(mouse)
  113. selected = true
  114. coroutine.resume(coroutine.create(function()
  115. while selected do
  116. wait()
  117. bg.cframe = CFrame.new(ball.Position, mouse.Hit.p)
  118. end
  119. end))
  120. mouse.Button1Down:connect(function()
  121. hold = true
  122. tray.BrickColor = BrickColor.new("Really red")
  123. tray.Parent = model
  124. coroutine.resume(coroutine.create(function()
  125. while hold do
  126. wait()
  127. local dist = (ayh.Position - mouse.Hit.p).magnitude
  128. tm.Scale = Vector3.new(1,1,dist)
  129. tray.CFrame = CFrame.new(ayh.Position, mouse.Hit.p) * CFrame.new(0,0,-dist/2)
  130. end
  131. end))
  132. if mode == "color" then
  133. local col = happycolors[math.random(1,#happycolors)]
  134. tray.BrickColor = BrickColor.new(col)
  135. coroutine.resume(coroutine.create(function()
  136. while hold do
  137. if mouse.Target ~= nil then
  138. if mouse.Target.Name ~= "Base" then
  139. mouse.Target.BrickColor = tray.BrickColor
  140. end
  141. end
  142. wait()
  143. end
  144. end))
  145. elseif mode == "remove" then
  146. tray.BrickColor = BrickColor.new("Bright red")
  147. if mouse.Target ~= nil then
  148. if mouse.Target:GetMass() < 3000 then
  149. mouse.Target:remove()
  150. end
  151. end
  152. end
  153. end)
  154. mouse.Button1Up:connect(function()
  155. hold = false
  156. tray.Parent = nil
  157. end)
  158. mouse.KeyDown:connect(function(key)
  159. key = key:lower()
  160. if key == "q" then
  161. mode = "color"
  162. elseif key == "f" then
  163. mode = "remove"
  164. end
  165. end)
  166. end
  167.  
  168. function desel()
  169. selected = false
  170. end
  171.  
  172. bin.Selected:connect(sel)
  173. bin.Deselected:connect(desel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement