UsernameRTX

Driving Simulator Rainbow Vehicle

Apr 28th, 2021 (edited)
1,099
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local RunService = game:GetService("RunService")
  2. local Players = game:GetService("Players")
  3.  
  4. local LocalPlayer = Players.LocalPlayer
  5.  
  6. local Vehicle = (function()
  7.     for Number, Instance2 in pairs(workspace["$cars"]:GetChildren()) do
  8.         if Instance2.State.Owner.Value == LocalPlayer then
  9.             return Instance2
  10.         end
  11.     end
  12. end)()
  13.  
  14. local Frequency = 1 --Basically Speed!
  15. local AngularFrequency = 2 * math.pi * Frequency / 255
  16. local Phase = math.rad(0)
  17.  
  18. RunService.RenderStepped:Connect(function()
  19.     Vehicle.Body.PrimaryBody.Color = Color3.fromHSV(math.abs(math.sin(AngularFrequency * tick() + Phase)), 1, 1)
  20. end)
RAW Paste Data