:FireClient() not updating GUI

I have a server script that changes an ImageLabel’s image and location.

This works perfectly fine when I :FireClient() myself, however when I pass a different player via a character I got from :GetPlayerFromCharacter, it runs fine but doesn’t change their GUI.

When I change the ImageLabel again (in this case, when I hit the other player) the GUI will suddenly update to the right location and image.

I don’t know if this is an issue with the code or if it’s just a network issue, but the core issue is that FireClient works on myself but not when I pass others.

this is a very simplified version of what I’m doing but you get the idea

-- Server Script
for i, v in pairs(HitboxArea) do
   if v.Parent:FindFirstChild("Humanoid") and not HitTable[v.Parent.Name] and v.Parent ~= Character then
        local EnemyPlayer = PlayerService:GetPlayerFromCharacter(v.Parent)
        ChipSpendRE:FireClient(Player) --This fires myself, and works as intended
        if PlayerService:GetPlayerFromCharacter(EnemyHumanoid.Parent) ~= nil then
            ChipSpendRE:FireClient(EnemyPlayer) -- this fires a different player, and runs the code with no errors and print checks are fine, but does not update the GUI
        end
    end
end

-- Local Script
ChipSpendRE.OnClientEvent:Connect(function()
	print("fired")
	ImageLabel.Image = "rbxassetid://85975068489499"
end)

If the message is bring printed on both entities, then the issue is elsewhere. I would try accessing the ui object directly through player gui in case you have something else moved around. Your console is printing “Fired2”, whereas the segment you send says “fired,” an inconsistency I’m assuming you recognize.

Forgot to take this down but this was moreso a problem with my code. I was just changing it too soon and adding a small wait before it made changes fixed it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.