so heres my issue: i am making a box destroying minigame and u have to destroy boxes to get more points. when there is no more boxes in the workspace, its supposed to clone one box from the replicated storage to the workspace, and it does that. and the script from the box in the workspace works. however when the one in the replicated storage is cloned into workspace, that scrip(which is the same) no longer works? help!!
script in serverscriptservice
while wait(1) do
if not workspace:FindFirstChild("box") then
print("reshuffling");
local msg = Instance.new("Message", workspace)
msg.Text = "No more boxes! Reshuffling..."
local clone = game.ServerStorage.box:Clone()
clone.Parent = workspace
wait(3)
msg:Destroy()
end
end
script in the box
game.Players.PlayerAdded:Connect(function(plr)
local leader = plr:WaitForChild("leaderstats")
local box = leader:FindFirstChild("Boxes Destroyed")
script.Parent.Touched:Connect(function(hit)
local h = hit.Parent:WaitForChild("Humanoid")
if h ~= nil then
wait()
box.Value = box.Value + 1
script.Parent:Destroy()
end
end)
end)
Any help would be greatly appreciated oWo

2 comments
tysm it works :)
np, hope you have a great week!