the error: 16:11:18.310 - er is not a valid member of PlayerGui
game.ReplicatedStorage.Transfromgold.UNDOTRANS.OnServerEvent:Connect(function(plr)
local chr = plr.Character
local hum = chr.Humanoid
for _,none in pairs(hum:GetChildren()) do
if none:IsA("NumberValue") then
none:Remove()
end
end
wait(.12)
local waited = plr.PlayerGui.er:WaitForChild("er")
for _,kill in pairs(waited:GetChildren()) do
if kill:IsA("NumberValue") then
local copy = kill:Clone()
wait(.12)
copy.Parent = hum
end
end
end)
end)
the firing 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)

3 comments
:Remove() is decaperated, use :Destroy()
Is "er" inside the PlayerGui?
yeah