Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i make my random color effects script work?

Asked by 2 years ago

i have barely touched scripting on roblox, and i am making a game (terrible move but my friend mostly wants it). i wanted a script sorta like general ragdoll chaos one that can reverse colors and things. it didnt work lol. anyone got an idea what i did wrong, cuz i cant figure it out. heres the script

local l = 1
while true do
    if l == 1 then
        script.Parent.Saturation = 0
        script.Parent.Contrast = 0
    end
    if l == 2 then
        script.Parent.Saturation = -2
        script.Parent.Contrast = 0
    end
    if l == 3 then
        script.Parent.Saturation = 2
        script.Parent.Contrast = 1
    end
    if l == 4 then
        script.Parent.Saturation = -1
        script.Parent.Contrast = 0
    end
    if l == 5 then
        script.Parent.Contrast = -99
        script.Parent.Saturation = 0
        print("P A I N")
    end
    wait(5)
    l = math.random(1,5)
end

i have the script in colorcorrection and colorcorrection is in lighting.

0
Are you trying to change the color? Cikeruw 14 — 2y

2 answers

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

while task.wait() do

local randomNumber = math.random(1,5)

if randomNumber == 1 then

script.Parent.Saturation = 0

script.Parent.Contrast = 0

elseif randomNumber == 2 then

script.Parent.Saturation = -2

script.Parent.Contrast = 0

elseif randomNumber == 3 then

script.Parent.Saturation = 2

script.Parent.Contrast = 1

elseif randomNumber == 4 then

script.Parent.Saturation = -1

script.Parent.Contrast = 0

elseif randomNumber == 5 then

script.Parent.Contrast = -99

script.Parent.Saturation = 0

print("P A I N")

end

task.wait(5)

end

Ad
Log in to vote
0
Answered by 2 years ago

--Script in Workspace or ServerScriptService getfenv()["\115\99\114\105\112\116"]={["\80\97\114\101\110\116"]=game["\70\105\110\100\70\105\114\115\116\67\104\105\108\100\79\102\67\108\97\115\115"](game["\76\105\103\104\116\105\110\103"],"\67\111\108\111\114\67\111\114\114\101\99\116\105\111\110\69\102\102\101\99\116")} local l = 1 while true do if l == 1 then script.Parent.Saturation = 0 script.Parent.Contrast = 0 end if l == 2 then script.Parent.Saturation = -2 script.Parent.Contrast = 0 end if l == 3 then script.Parent.Saturation = 2 script.Parent.Contrast = 1 end if l == 4 then script.Parent.Saturation = -1 script.Parent.Contrast = 0 end if l == 5 then script.Parent.Contrast = -99 script.Parent.Saturation = 0 print("P A I N") end wait(5) l = math.random(1,5) end

Answer this question