I'm trying to make a gun and
I want the Gui to update its stats(Ammo, Gun Name, Max Ammo).
ERROR:20:54:15.911 - Unable to cast value to Object
-- This a local script in the Pistol
local GunName = 'Pistol'
local Ammo = 20
local MaxAmmo = 20
Remote:FireClient(GunName,Ammo,MaxAmmo)
-- This a local script in the StarterGui
local Remote = game.ReplicatedStorage:WaitForChild('GunStatsRemote')
local Background = script.Parent:FindFirstChild('Background')
local AmmoLabel = Background.AmmoLabel
local GunLabel = Background.GunLabel
Remote.OnClientEvent:connect(function(GunName, Ammo, MaxAmmo)
GunLabel.Text = GunName
AmmoLabel.Text = Ammo..'/'..MaxAmmo
end)
I'm not sure how to fix this problem, I rarely use RemoteEvents.

2 comments
Oooooooo
ya, i ran into the same problem a couple weeks ago too. so i hope this helped :)