local ammo = script.Parent.Ammo.Value
local ammoGui = game.StarterGui.GunGui.BackgroundFrame.AmmoDisplay
local function onUpdateAmmoDisplay()
while wait() do
ammoGui.Text = ammo.."/"..maxAmmo
end
end
spawn(onUpdateAmmoDisplay)
✓ ANSWER ACCEPTED
So I'm making a gun it works but the ammo won't show in my TextLabel, can anyone help?
1 answer
✓ Accepted answer
you are modifying the StarterGui, everything thats inside the startergui gets cloned into the PlayerGui of a player so if you modify something in StarterGui it will only show after the players dies so if you want the modify it instantly you have to modify the PlayerGui
the PlayerGui is part of the player. like this Player.PlayerGui
2 comments
0
@VerdommeMan Thank you so much! That saved me hours!
0
No problem also i think brady i s rigth, ammo has the value Ammo.Value, but not the reference of Ammo so anything u change to ammo riight now will not affect Ammo (ammo being here the name of var and Ammo is script.Parent.Ammo))
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
I know it's a stupid question, but I can't figure it out lol
see Verdomme's answer
I don't think you defined ammo correctly. Try rereading and rewriting your code.