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)