game.ReplicatedStorage.Transfromgold.UNDOTRANS.OnServerEvent:Connect(function(plr)
local chr = plr.Character
local hum = chr.Humanoid
local waited = plr.PlayerGui:WaitForChild("er")
for _,none in pairs(hum:GetChildren()) do
if none:IsA("NumberValue") then
none:Destroy()
end
end ---this part wont work
for _,kill in pairs(waited:GetChildren()) do
if kill:IsA("NumberValue") then
local copy = kill:Clone()
copy.Parent = workspace
end
end
---
end)
the local script
local tem = "None"
local InputService = game:GetService("UserInputService")
InputService.InputBegan:Connect(function(input)
-- on
local key = input.KeyCode
if key == Enum.KeyCode.R then
game.ReplicatedStorage.Transfromgold.Trans:FireServer()
print("fired")
end
end)
-----
InputService.InputBegan:Connect(function(input)
local plr = game.Players.LocalPlayer
local chr = plr.Character
local hum = chr.Humanoid
local key = input.KeyCode
if key == Enum.KeyCode.E then
game.ReplicatedStorage.Transfromgold.UNDOTRANS:FireServer()
end
end)

2 comments
I think your Destroying the instance too soon. Destroy() “Sets the Instance.Parent property to nil, locks the Instance.Parent property, disconnects all connections and calls Destroy on all children.”
none is not an is instance its a pairs