Need help with breaking block stage script

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Currently there’s 10 stages (0 to 9) when destroying a block in my game, I want to add more stages to make it more clean when destroying the block!

  2. What is the issue? Include screenshots / videos if possible!
    I don’t know how exactly to do so. ! https://gyazo.com/887cf5b371adc178cd4958df6836e45d.png)
    https://gyazo.com/887cf5b371adc178cd4958df6836e45d Picture of the stages… SCRIPT pic:


    https://gyazo.com/35a757b2335b4660aaec26e295b55a64

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried editing some values but did not work!

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
I explained in 1. basically

			if exist.dstage and (exist.dstage >= 0) and (exist.dstage < 10) then
				local left = {}
				for _,v in pairs(exist.part:GetChildren()) do
					if v.Name == "BreakSG" then
						left[v.Face] = true
						for i=0,exist.dstage do
							v["Stage" .. i].Visible = true
						end
					end
				end
				for _,v in pairs(Enum.NormalId:GetEnumItems()) do
					if not left[v] then
						local bsg = script.BreakSG:Clone()
						bsg.Face = v
						for i=0,exist.dstage do
							bsg["Stage" .. i].Visible = true
						end
						bsg.Parent = exist.part
					end
				end
			else
				for _,v in pairs(exist.part:GetChildren()) do
					if v.Name == "BreakSG" then
						v:Destroy()
					end
				end
			end

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like

The second picture isnt visible but its off the stages: https://gyazo.com/887cf5b371adc178cd4958df6836e45d

You need to be more clear about what you’re trying to achieve and what problem you’re having with achieving it.

1 Like

Currently as you can see on my previous reply I sent a screenshot of all the Stages. When you are destroying a block etc like in minecraft theres a pattern with 10 stages from 0 to 9. I have like that too but I wanna add more stages to make the animations smoother but I am not sure what to edit in this script to make the script work for more than 0 to 9 so i want to add etc Stage 10 but that doesnt work because something in the script has to be edited

If this the line you want to change?

if exist.dstage and (exist.dstage >= 0) and (exist.dstage < 20) then --Change that number?