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

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

Part = Instance.new("Part")
Part.Size = Vector3.new(1,3,3)
Part.BrickColor = BrickColor.new(23)
Part.Transparency = .3
Part.Reflectance = .3
Part.Parent = game.Lighting
Part.Name = "Trail"
s = Instance.new("Script")
s.Parent = game.Lighting.Trail
s.Source = [[
wait(2)
script.Parent:Destroy()
]]

3 answers

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

1 comment

0

Indeed, just replace the "s.Source = [[ wait(2) script.Parent:Destroy() ]]" part with "wait(2) s:Destroy()".

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.

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