Advertisement
1m1m0

Star (Size, Color & Trail Jitter)

Jan 1st, 2024
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. local part = script.Parent
  2.  
  3. -- Color Randomizer --
  4.  
  5. function getRandomColor()
  6.     local red = math.random()
  7.     local green = math.random()
  8.     local blue = math.random()
  9.     return Vector3.new(red, green, blue)
  10. end
  11. function changePartColor()
  12.     local color = getRandomColor()
  13.     part.Color = Color3.new(color.x, color.y, color.z)
  14. end
  15. changePartColor()
  16.  
  17. -- Size Randomizer --
  18.  
  19. function getRandomSize()
  20.     local sizeValue = math.random(300, 550) / 100
  21.     return Vector3.new(sizeValue, sizeValue, sizeValue)
  22. end
  23. function changePartSize()
  24.     local size = getRandomSize()
  25.     part.Size = size
  26. end
  27. changePartSize()
  28.  
  29. -- Trail Randomizer --
  30.  
  31. local Trail = script.Parent:WaitForChild("Trail")
  32. local r = math.random()
  33. local g = math.random()
  34. local b = math.random()
  35. local color = Color3.new(r, g, b)
  36. local colorSequence = ColorSequence.new(color)
  37. Trail.Color = colorSequence
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement