Hi, I'm making a system where I want to fire a specific client with the value of Experience which is in an object. I know I have the right path to all the things including my variables, I just don't know what is causing this error. Here is my script for server. My local script works perfectly fine, the error is appearing in the server script.
local rS = game:GetService("ReplicatedStorage")
local remoteEvents = rS.RemoteEvents
local dmgEv = remoteEvents.Damaged
dmgEv.OnServerEvent:Connect(function(plr, block, dmg, waitingTime)
print(block.Name.." is the block")
if block.Health.Value >= dmg then
wait(waitingTime)
block.Health.Value = block.Health.Value - dmg
if block.Health.Value == 0 then
plr.Experience.Value = plr.Experience.Value + block.Experience.Value
block.Anchored = false
print(block:WaitForChild("Experience").Value) --//Prints
remoteEvents:WaitForChild("XpNotify"):FireClient(block:WaitForChild("Experience").Value)
end
else
wait(waitingTime)
if block.Health.Value ~= 0 then
plr.Experience.Value = plr.Experience.Value + block.Experience.Value
block.Health.Value = 0
block.Anchored = false
remoteEvents.XpNotify:FireClient(block.Experience.Value)
else
remoteEvents.XpNotify:FireClient(block.Experience.Value)
block.Health.Value = 0
plr.Experience.Value = plr.Experience.Value + block.Experience.Value
end
end
end)
The error occurs on this line
remoteEvents:WaitForChild("XpNotify"):FireClient(block:WaitForChild("Experience").Value)
22:28:39.785 - Unable to cast value to Object
Thanks for your time. All help is appreciated.

3 comments
Hope this solved your problem.
If you use :FireAllClient() you do not have to pass through a player as a parameter. But, this answer is indeed correct.
wow my eyes didn't spot that.