server script placed inside the coin
local reward=25
if energy<capacity then
player.leaderstats.energy.Value+=reward
coin.Parent=game:GetService('ReplicatedStorage')
else
fullpopup:FireClient(player)
print('maximum energy has been reached!')
end
wait(2)
coin.Parent=workspace```
local script placed inside screengui
```local fullpopup=script.Parent.fullPopUp
local popupevent=game:GetService('ReplicatedStorage').fullpopup
popupevent.OnClientEvent:Connect(function()
fullpopup.Visible=true
end)```