
13.3k Views
111 Executions
rainbow spinning cube
Universal Script 📌
hiffPublished 5
3 years ago
Please login to perform these actions:Does it work?
No reports yetNo reports yet. Tried it? Be the first to say.
Also noticed:
Description
a rainbow spinning cube, quality. (my next script will be big, and now you wont call me the non-usefulness scripter.) also made a version that follows you, check it out: https://pastebin.com/n2yp5pVh NOTE: This is a reupload due to the data rollback, you may have already seen this.
local Players = game:GetService("Players")
local rainbowBlock = Instance.new("Part")
rainbowBlock.Size = Vector3.new(5, 5, 5)
rainbowBlock.Anchored = true
rainbowBlock.CanCollide = false
local rotationSpeed = 2 -- Adjust the speed of rotation as desired
rainbowBlock.Parent = game.Workspace
local function setPositionBehindCharacter(character, distance)
local rootPart = character:FindFirstChild("HumanoidRootPart")
if rootPart then
local direction = -rootPart.CFrame.lookVector
return rootPart.Position + direction * distance
end
return character.PrimaryPart.Position - Vector3.new(0, distance, 0)
end
local character = Players.LocalPlayer.Character
if character then
rainbowBlock.Position = setPositionBehindCharacter(character, 15)
else
character = Players.LocalPlayer.CharacterAdded:Wait()
rainbowBlock.Position = setPositionBehindCharacter(character, 15)
end
local function setRainbowColor(part, angle)
local sectorSize = 360 / 6 -- Number of color sectors in the rainbow (6 for ROYGBIV)
local hue = (angle % 360) / sectorSize
local maxColor = Color3.new(1, 1, 1)
local minColor = Color3.new(0, 0, 0)
local sectorIndex = math.floor(hue) % 6
local t = hue - math.floor(hue)
if sectorIndex == 0 then
part.Color = maxColor:Lerp(Color3.new(1, 0, 0), t)
elseif sectorIndex == 1 then
part.Color = maxColor:Lerp(Color3.new(1, 1, 0), t)
elseif sectorIndex == 2 then









i mean if youre ever mad use this script to calm yourselves down
what is this for?