? Need help with this Regen Script.
--Hello, I'm a new scripter just getting into the fun of it and I've made this script that checks for int values and upon certain values changes the color of a brick and eventually breaks apart the blocks(it's supposed to do that) and everything in this script works just like I want it to.. except for my regen function (the first function) when I click my regen button on my GUI for the first time it works... however when I try to regen it a second time I get an error saying that
("The Parent property of SDoor is locked")
I'm not sure what this means and upon searching google I came up with nothing ? A little bit of help to enlighten me on what I'm doing wrong would be very much appreciated! I've included a screen shot of the error below
IMAGE LINK: http://imageshack.com/a/img834/284/ruvl.png
01 | copy = game.Workspace.SDoor.SDoor:Clone() |
04 | modd = game.Workspace.SDoor |
05 | modd 2 = game.Workspace.SDoor.SDoor |
20 | modd.safelight.hold.Value = 0 |
34 | door = script.Parent.Parent.SDoor:GetChildren() |
36 | modd 2 = game.Workspace.SDoor.SDoor |
38 | h = script.Parent.hold.Value |
39 | modd = game.Workspace.SDoor.SDoor:GetChildren() |
41 | screen = script.Parent.light |
55 | screen.BrickColor = BrickColor.new( "Lime green" ) |
59 | if modd [ j ] .Name = = "Part" then |
61 | modd [ j ] .CanCollide = true |
70 | screen.BrickColor = BrickColor.new( "Bright yellow" ) |
78 | if modd [ i ] .Name = = "Part" then |
81 | screen.BrickColor = BrickColor.new( "Really red" ) |