I'm trying to make it so the PlayerGui TextLabel says 4 and SurfaceGui TextLabel says 4 i shoot the gun the PlayerGui text turns into 3 and the SurfaceGui's TextLabel changes to 3 as well and know that im not that good at scripting and im using the Template Assault Rifle script. I tried it and i get this error
02:30:07.736 - WeaponHud is not a valid member of PlayerGui
local Player = game.Players.LocalPlayer local GUI = Player.PlayerGui local ClipAmmo = GUI.WeaponHud.AmmoHud.ClipAmmo local TextLabel = script.Parent GUI:WaitforChild("AmmoHud") while true do TextLabel.Text = ClipAmmo end
you are setting the textlabels text to the clipammo, not the clipammo text.
local Player = game.Players.LocalPlayer local GUI = Player.PlayerGui local ClipAmmo = GUI.WeaponHud.AmmoHud.ClipAmmo.Text local TextLabel = script.Parent GUI:WaitforChild("AmmoHud") while true do TextLabel.Text = ClipAmmo end
-- This will need to be in local script local Player = game.Players.LocalPlayer local GUI = Player.PlayerGui local ClipAmmo = GUI.WeaponHud.AmmoHud.ClipAmmo.Text local TextLabel = script.Parent GUI:WaitforChild("AmmoHud") while true do TextLabel.Text = ClipAmmo end
If still not working:
-- This will need to be in local script local Player = game.Players.LocalPlayer local GUI = game:GetService("StarterGui") local ClipAmmo = GUI.WeaponHud.AmmoHud.ClipAmmo.Text local TextLabel = script.Parent GUI:WaitforChild("AmmoHud") while true do TextLabel.Text = ClipAmmo end
AND IF STILL NOT WORKING
-- This will need to be in local script local Player = game.Players.LocalPlayer local GUI = game:GetService("PlayerGui") local ClipAmmo = GUI.WeaponHud.AmmoHud.ClipAmmo.Text local TextLabel = script.Parent GUI:WaitforChild("AmmoHud") while true do TextLabel.Text = ClipAmmo end