Universal Script 📌
13.3k Views
111 Executions

rainbow spinning cube

Universal Script 📌
hiff
hiffPublished 5
3 years ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No 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.

View Raw
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


Comments

2
Log in to join the conversation. Login
hiff's profile picture
hiffUploader3 years ago(edited)

i mean if youre ever mad use this script to calm yourselves down

1
skuidigaming1's profile picture
skuidigaming13 years ago(edited)

what is this for?

1

Tags

More universal scripts

See all
Script hub
272.4k
884.6k
Bumped 4 minutes ago
Key System

Script hub

#16 this week

Verified script badgeAxon Hub 60+ Games & 800+ Features

Script hub
30.1k
92.0k
Bumped 4 hours ago
Key System

Script hub

#2 this week

Verified script badgeArcane Hub | 125+ Games & 4000+ Features

Script hub
138.6k
417.6k
Bumped 5 hours ago
Key System

Script hub

Hall of Fame #6

Verified script badgeAcro Hub | Easy Key System

Script hub
3.9M
964.8k
Bumped 5 hours ago

Script hub

Hall of Fame #3

KeylessVerified script badge[KEYLESS] Moondiety Script | 20+ supported Games

Universal Script 📌
1.1k
152
Bumped 6 hours ago
Key System
Script hub
525
10
Approved 7 hours ago
Key System
Paid