Log in to vote

Why can't I set this script's Source?

Asked by 7 years ago
Part ="Part")
Part.Size =,3,3)
Part.BrickColor =
Part.Transparency = .3
Part.Reflectance = .3
Part.Parent = game.Lighting
Part.Name = "Trail"
s ="Script")
s.Parent = game.Lighting.Trail
s.Source = [[

3 answers

Log in to vote
Answered by
Axstin 55
7 years ago

As far as I know, you can't edit a script's source with a normal Script or LocalScript. That's probably the problem. :P

Indeed, just replace the "s.Source = [[ wait(2) script.Parent:Destroy() ]]" part with "wait(2) s:Destroy()". TheMyrco 375 — 7y
Log in to vote
Answered by 7 years ago

Just a side note, you should use ServerStorage instead of Lighting for storing items. They're more or less the same thing, except ServerStorage is official

Also, you could probably make the separate delete script beforehand, make it Disabled = true, place it into ServerStorage and THEN clone it into the trail. Then, when you want it to, make Disabled = false, so that it doesn't delete itself while in ServerStorage.

Log in to vote
Answered by 7 years ago

Read this

And also just use this instead of having to insert an entirely new script.

game.Debris:AddItem(game.Lighting.Trail, 2)

Answer this question