Trying to duplicate a part based on multiple int value inside of multiplier brick.
Not much to say so here is the script, error, and context
local Part = script.Parent
local textt = Part:WaitForChild("SurfaceGui").TextLabel
local multiplier = Part.Multiple.Value
local id = Part.ID
textt.Text = "x" .. multiplier
if hit.Name == "Origin" or hit.Name == "Ball" then
if hit:FindFirstChild("Touched").Value ~= id.Value then
hit.Touched.Value = 1
for i = 1, multiplier do
local hc = hit:Clone()
hc.Touched.Value = id.Value
hc.Name = "Ball"
hc.Parent = game.Workspace
(Ignore the prints in the script they were for debugging)