How this script works is when the player clicks the item the counter will go up by 1 then the item will disappear 0 -> 1
Thats all working and good
Num = 0
PickUp = script.Parent
function OnClicked(plyr)
Num = Num + 1
plyr.PlayerGui.Counter.Number.Text = Num
PickUp:Destroy()
end
PickUp.ClickDetector.MouseClick:Connect(OnClicked)
But! When the counter is showing 1 and the player goes to pick up another item. Instead of changing the value to 2 it stays saying 1 and always 1.
I could just pick up 10 items and the counter will always stay at 1
Any fix?
('Counter' is a ScreenGui and 'Number' is a TextLabel)

4 comments
Where is this script located, I'm pretty sure a player's gui can't be changed from a script outside. You would have to use a remote event
The script is inside a part
^ You don't need a remote event, if you change it from a local script then only that player will see that amount of money.
^ You don't need a remote event, if you change it from a local script then only that player will see that amount of money.