so i'm pretty new at scripting , but i tried scripting a light bulb that turns neon and provides light, but then the light destroys, i used this script:
light = Instance.new("PointLight")
while true do
wait(4)
script.Parent.BrickColor = BrickColor.new("New Yeller")
script.Parent.Material = ("Neon")
light.Range = 65
light.Color = Color3.new(255,255,255)
wait(3)
script.Parent.BrickColor = BrickColor.new("Really black")
script.Parent.Material = ("Plastic")
script.Parent.PointLight:Destroy()
end
in the output, there was this error: "The current identity (2) cannot Class security check (lacking permission 3)
i could have fixed the problem , but the output literally makes no sense because i can't understand what it wants me to fix.

8 comments
Is this a local script? What line did it say the error on?
it's a script in a Parent , not a local script. also when i start up my game it starts with : "loadstring() is not available"
It isn't a local script, because look "script.Parent.BrickColor", it's inside of a BasePart instance. Not sure why it is happening tho. A workaround would be just to do light.Enabled = false
Recarding the "loadstring() is not available" might be either a infected model attempting to install a backdoor or a plugin. Be careful.
i forgot to tell that only instance new isn't working , i had a plugin called content deleted, so i deleted it out of my profile , i also found some strange scripts in some of my parts which i never put them in there. but it's still the same.
That's a big problem, you need to go through your entire game and delete those scripts and also in the future, be careful with free models and plugins.
I still have the same problem , also the strange scripts appear in the parts that you spawn by yourself. my guess it was caused by a plugin.
Once an object's destroy, it's locked; you can no longer do anything with it.