So I wanted to try make a Pistol HUD for my pistol ammo but the GUI doesn’t change
The screengui is in StarterGUI and its disabled, but the ammo text doesn’t change at all and there is no errors in the log. Also sorry if its something dumb im not really the best at scripting.
gui is supposed to appear when i equip a tool, it does appear but the ammo text and tool name doesn’t change when the value changes
im not sure if its even possible to do it this way so please tell me what i did wrong
local CurrentAmmo = script.Parent:WaitForChild("CurrentAmmo")
local AmmoCapacity = script.Parent.Configuration:WaitForChild("AmmoCapacity")
local player = game.Players.LocalPlayer
local GUI = player.PlayerGui
local AmmoUI = GUI:WaitForChild("AmmoUI")
local AmmoMainFrame = AmmoUI:WaitForChild("MainFrame")
local AmmoText = AmmoMainFrame:WaitForChild("Ammo")
script.Parent.Equipped:Connect(function()
AmmoUI.Enabled = true
AmmoText = CurrentAmmo.Value
AmmoText = script.Parent.Name
end)
script.Parent.Unequipped:Connect(function()
AmmoUI.Enabled = false
end)