Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My light isn't flickering like it should?

I want to make a Light that flickers between being on and off. I currently have a Part with a PointLight and a Script inside of it. The Script is not inside the PointLight.

Here is the code:

local LightPart = game.workspace.LightPart
local PointLight = game.Workspace.LightPart.PointLight

while true do
	wait(.1)
	LightPart.Material.Enum = SmoothPlastic
	PointLight.Enabled = false
	wait(.1)
	LightPart.Material.Enum = Neon
	PointLight.Enabled = true
end

1 comment

0

I’m sending you a friends req on Roblox accept it and we can go into studio together

1 answer

Instead of doing (also it helps if you tell what the error is)

local LightPart = game.workspace.LightPart
local PointLight = game.Workspace.LightPart.PointLight

You should do this instead.. If I'm incorrect please correct me on this. so basically you have a script inside of that part, if so do this

local LightPart = script.LightPart -- This script is in a part
local PointLight = script.Parent.PointLight
print ("This works") -- You can remove this if you want

If your script is in a model and not in a part then do this

local LightPart = script.Parent.LightPart -- This script is in a model
local PointLight = script.Parent.Parent.PointLight
print ("This works") -- You can remove this if you want

You can remove the print() if you want, and if there's something wrong about it please tell me! PLEASE give me the error if something is wrong in my script.

AGAIN If I'm incorrect please correct me on this. So basically you have a script inside of that part

5 comments

0

Hey man I’m going to send you a friends req too. I would like to do a team create challenge.

0

For? I'm curious

0

I like challenging people to script battles to see who get a certain thing done the quickest. It challenges the users and makes them learn new things.

0

Who can get*^

0

Also love learning new things from different players

This discussion is preserved as it was. New answers, comments, and votes are closed.