Advertisement
BobMe

part

Jun 29th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. local player = owner
  2. local part = Instance.new("Part",workspace)
  3. part.Size = Vector3.new(1.5,1.5,1.5)
  4. part.Color = Color3.fromRGB(255,0,0)
  5. part.Anchored = true
  6. part.Material = Enum.Material.Neon
  7. local click = Instance.new("ClickDetector",part)
  8.  
  9. -- Objects
  10.  
  11. local BillboardGui = Instance.new("BillboardGui")
  12. local Frame = Instance.new("Frame")
  13. local TextLabel = Instance.new("TextBox")
  14.  
  15. -- Properties
  16.  
  17. BillboardGui.Parent = part
  18. BillboardGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  19. BillboardGui.Active = true
  20. BillboardGui.Size = UDim2.new(5, 0, 2, 0)
  21. BillboardGui.StudsOffset = Vector3.new(0, 5, 0)
  22.  
  23. Frame.Parent = BillboardGui
  24. Frame.BackgroundColor3 = Color3.new(1, 1, 1)
  25. Frame.Size = UDim2.new(1, 0, 1, 0)
  26.  
  27. TextLabel.Parent = BillboardGui
  28. TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  29. TextLabel.Size = UDim2.new(1, 0, 1, 0)
  30. TextLabel.Font = Enum.Font.SourceSans
  31. TextLabel.Text = "I have been clicked 0 times"
  32. TextLabel.TextColor3 = Color3.new(0, 0, 0)
  33. TextLabel.TextScaled = true
  34. TextLabel.TextSize = 14
  35. TextLabel.TextWrapped = true
  36.  
  37. -- Scripts
  38.  
  39. local r = 255
  40. local g = 0
  41. local b = 0
  42. local num = 0
  43.  
  44. function shiftcolor()
  45. if r == 255 and g < 255 and b == 0 then
  46. g = g + 1
  47. elseif r > 0 and g == 255 then
  48. r = r - 1
  49. elseif g == 255 and b < 255 then
  50. b = b + 1
  51. elseif g > 0 and b == 255 then
  52. g = g - 1
  53. elseif b == 255 and r < 255 then
  54. r = r + 1
  55. elseif b > 0 and r == 255 then
  56. b = b - 1
  57. end
  58. end
  59.  
  60. click.MouseClick:Connect(function()
  61. shiftcolor()
  62. num = num + 1
  63. TextLabel.Text = "I have been clicked\n"..tostring(num).."\ntimes"
  64. TextLabel.BackgroundColor3 = Color3.fromRGB(r,g,b)
  65. part.Color = Color3.fromRGB(r,g,b)
  66. end)
  67.  
  68. while wait() do
  69. part.CFrame = player.Character.Head.CFrame * CFrame.new(0,4.74,0)
  70. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement