Idea The goal of this tool is so every time the player clicks a value in the tool goes down by one, and every time it goes down, an imagelabel also changes to correlate.
Problem The only issue with this script is that it works once. the player clicks once, the gui changes to correlate and then nothing else. when you click again the value goes down but the gui remains the same. I get no errors.
Code
tool = script.Parent
plr = game.Players.LocalPlayer
mags = tool.Mags
tool.Equipped:connect(function(mse)
mouse = mse
mouse.Button1Down:connect(function()
mags.Value = mags.Value -1
if mags.Value == 5 then
plr.PlayerGui.PlayerHud.Ammoi.Image = "rbxassetid://393235619"
if mags.Value == 4 then
plr.PlayerGui.PlayerHud.Ammoi.Image = "rbxassetid://393236237"
if mags.Value == 3 then
plr.PlayerGui.PlayerHud.Ammoi.Image = "rbxassetid://393236950"
if mags.Value == 2 then
plr.PlayerGui.PlayerHud.Ammoi.Image = "rbxassetid://393237626"
if mags.Value == 1 then
plr.PlayerGui.PlayerHud.Ammoi.Image = "rbxassetid://393238117"
if mags.Value == 0 then
plr.PlayerGui.PlayerHud.Ammoi.Image = "rbxassetid://393238639"
end
end
end
end
end
end
end)
end)
tool.Unequipped:connect(function()
end)
Thanks
