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