So the confetti is supposed to be on the second one and so on but it never duplicates the part into it after the first time. (sorry if the audio is duplicated it’s because I had studio and the roblox game open)
game.ReplicatedStorage.remotes.clickRe.OnServerEvent:Connect(function(plr)
local clickDb = plr:WaitForChild("clickDb")
if clickDb.Value == false then
local doneDb = plr:WaitForChild("doneDb")
doneDb.Value = false
game.ReplicatedStorage.remotes.clickRe:FireClient(plr)
clickDb.Value = true
plr.Character.Humanoid.WalkSpeed = 0
workspace["Dice Shake 7 (SFX)"].Playing = true
for i,v in pairs(game.ReplicatedStorage.Dice:GetChildren()) do
if v.Name == plr:WaitForChild("equippedDie").Value then
local dupe = v:Clone()
dupe.Parent = plr.Character
dupe.Position = Vector3.new(plr.Character.HumanoidRootPart.Position.X, plr.Character.HumanoidRootPart.Position.Y + 6 ,plr.Character.HumanoidRootPart.Position.Z)
while task.wait() do
if doneDb.Value == false then
if plr.Character.Humanoid.FloorMaterial == Enum.Material.Air then
plr.leaderstats.Rolls.Value += 1
--dupe.Position = Vector3.new(plr.Character.HumanoidRootPart.Position.X, plr.Character.HumanoidRootPart.Position.Y + 2 ,plr.Character.HumanoidRootPart.Position.Z)
local popDupe = game.ReplicatedStorage.Dice.popEffect:Clone()
popDupe.Parent = dupe.Parent
popDupe.CFrame = dupe.CFrame
plr.Character.Humanoid.WalkSpeed = 16
game.Workspace["Dice Shake 7 (SFX)"].Playing = false
game.Workspace["Poof sound"]:Play()
doneDb.Value = true
wait(1)
popDupe:Destroy()
dupe:Destroy()
wait(0.1)
if dupe then
dupe:Destroy()
end
repeat
wait(0.1)
plr:WaitForChild("PlayerGui").rollScreen.Roll.RollButton.timer.Value -= 0.1 * plr:WaitForChild("rollSpeedMultiplier").Value
for i,v in pairs(plr.Character:GetChildren()) do
if v:IsA("UnionOperation") then
v:Destroy()
end
end
until plr:WaitForChild("PlayerGui").rollScreen.Roll.RollButton.timer.Value <= 0
plr.PlayerGui.rollScreen.Roll.RollButton.timer.Value = 5
clickDb.Value = false
else
dupe.Orientation += Vector3.new(0, 10, 10)
dupe.Position = Vector3.new(plr.Character.HumanoidRootPart.Position.X, plr.Character.HumanoidRootPart.Position.Y + 6 ,plr.Character.HumanoidRootPart.Position.Z)
game.Players.PlayerRemoving:Connect(function(playerRemove)
if playerRemove.Name == plr.Name then
dupe:Destroy()
end
end)
end
end
end
end
end
end
end)
Any help?