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:
equipEvent.OnServerEvent:connect(function(player)
player.Character.Humanoid.AutoRotate = false
player.PlayerGui.WeaponsUI.AmmoPistol.Visible = true
player.PlayerGui.WeaponsUI.AmmoPistol.Text = currentAmmo.."/"..clipSize
plr = player
end)
unequipEvent.OnServerEvent:connect(function(player)
player.Character.Humanoid.AutoRotate = true
player.PlayerGui.WeaponsUI.AmmoPistol.Visible = false
end)
Admin Version:
equipEvent.OnServerEvent:connect(function(player)
player.Character.Humanoid.AutoRotate = false
player.PlayerGui.WeaponsUI.AmmoAdminPistol.Visible = true
player.PlayerGui.WeaponsUI.AmmoAdminPistol.Text = currentAmmo.."/"..clipSize
plr = player
end)
unequipEvent.OnServerEvent:connect(function(player)
player.Character.Humanoid.AutoRotate = true
player.PlayerGui.WeaponsUI.AmmoAdminPistol.Visible = false
end)

1 comment
No problem :) I think you should be able to just have one event and one listener script though rather than one for each gun, just pass the name of the item you're equiping and find the appropriate UI using the passed name too :)