I can not figure out why both UI elements show when only one should, maybe this is a bug in roblox?
So, I have two scripts, one in each item, and both are modified versions of the Pistol model from the Toolbox, designed to look more like a laser weapon, and it tells you how much ammo is left using a Gui element. I have the scripts functional, but for some reason, equipping just one of them causes both Labels to appear. I have them separate so the reloading text doesnt display when another weapon is equipped. So the Admin Version of the weapon makes both the Admin weapon's ui and the Normal weapon's ui appear/disappear, but it should only be making the Admin ui appear. Similar story for the normal version, it makes the admin ui appear.
Normal Version:
01 | equipEvent.OnServerEvent:connect( function (player) |
02 | player.Character.Humanoid.AutoRotate = false |
03 | player.PlayerGui.WeaponsUI.AmmoPistol.Visible = true |
04 | player.PlayerGui.WeaponsUI.AmmoPistol.Text = currentAmmo.. "/" ..clipSize |
07 | unequipEvent.OnServerEvent:connect( function (player) |
08 | player.Character.Humanoid.AutoRotate = true |
09 | player.PlayerGui.WeaponsUI.AmmoPistol.Visible = false |
Admin Version:
01 | equipEvent.OnServerEvent:connect( function (player) |
02 | player.Character.Humanoid.AutoRotate = false |
03 | player.PlayerGui.WeaponsUI.AmmoAdminPistol.Visible = true |
04 | player.PlayerGui.WeaponsUI.AmmoAdminPistol.Text = currentAmmo.. "/" ..clipSize |
07 | unequipEvent.OnServerEvent:connect( function (player) |
08 | player.Character.Humanoid.AutoRotate = true |
09 | player.PlayerGui.WeaponsUI.AmmoAdminPistol.Visible = false |