Why is my script not working? [solved]

So my game hit 300k visits and i wanna make a /party command. for some reason its not working .:frowning: any help?
SCRIPTS
“party” script: parent is Workspace

game.Players.PlayerAdded:Connect(function(plr)
	local DevID = 3095433661
	if plr.UserId == DevID then
		plr.Chatted:Connect(function(msg)
			local Cmd = string.split(string.lower(msg)," ")
			if Cmd[1] == "/party" then
				if Cmd[2] == "on" then
					game.Lighting.Party.Enabled = true
				elseif Cmd[2] == "off" then
					game.Lighting.Party.Enabled = false
				end
			end
		end)
	end
end)

“Tween” script: Parent is “Party” ColorCorrection in Lighting

Data = {
	C1 = Color3.fromHex("#ff6161");
	C2 = Color3.fromHex("#ffbc5d");
	C3 = Color3.fromHex("#fffa5c");
	C4 = Color3.fromHex("#64ff59");
	C5 = Color3.fromHex("#64ff59");
	C6 = Color3.fromHex("#64ff59");
	C7 = Color3.fromHex("#d24cff");
	C8 = Color3.fromHex("#ff4bf0");
}

while wait(0.4) do
	script.Parent.TintColor = Data["C"..math.random(1,8)]
end

INSTANCES (i guess?)
Lighting
image
Workspace
image
ERRORS
nothing

if u need more info about something go on, ask me. ty
NOTE: the TWEEN script is the one that doesnt work

When you say not working… you mean the lights don’t flash? the script doesn’t run at all? it doesn’t turn off? it’s on constantly?

the colors dont change its white as it was
it torns on and off but it stays white

I parented the script in Serverscriptservice and now it works perfectly fine for me.

1 Like

Scripts only run when parented to Workspace or ServerScriptService, not Lighting. You can likely fix this by setting the Script’s RunContext to Script.

1 Like

the Tween script?
lemme try putting it there if you meant that

it worked!! tysm :))))

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.