It does fire to the client when the player joins (see below) but not in these scenarios:
for _, wep in weps do
local name, curr, cost = wep.name, wep.curr, wep.cost
local showcaseWep, useWep = showcase:FindFirstChild(name, true), weapons:FindFirstChild(name, true)
local wepClone = useWep:Clone()
for _, part in wepClone:GetDescendants() do
if not (part:IsA(`Part`) or part:IsA(`MeshPart`)) then continue end
local clone = part:Clone()
clone.Anchored = true
clone.Parent = showcaseWep.Glass
clone.Position = showcaseWep.Glass.Position
showcaseWep.Top.Cost.Cost.Text = `{name:gsub(`(%l)(%u)`, `%1 %2`)} ({cost} {curr})`
Instance.new(`ClickDetector`, showcaseWep)
showcaseWep.ClickDetector.MouseClick:Connect(function(plr)
local char = plr.Character
local l = plr.leaderstats
local stat = l[curr]
local function showMsg(msg)
local plrGui = plr.PlayerGui
local notif = plrGui.Shop
local err = notif.Error
err.Visible = true
err.TextLabel.Text = msg
err.Close.MouseButton1Click:Once(function()
err.Visible = false
end)
end
if table.find(funcs:InvokeClient(plr, 'getInventory'), name) then -- client is not fired
rs.Sounds:FireClient(plr, 9066167010) -- (same problem on the server badges script (line 143), check the last section of inventory -> handler)
return showMsg(`You already have this sword!`)
end
if stat.Value >= cost then
stat.Value -= cost
if rs.Funcs:InvokeClient(plr, `equip`) then -- obviously this doesn't work too
useWep:Clone().Parent = plr.Backpack
end
rs.Sounds:FireClient(plr, 8522330758)
else
showMsg(`You don't have enough {curr:lower()} to purchase this!`)
rs.Sounds:FireClient(plr, 9066167010)
end
end)
end
game.Players.PlayerAdded:Connect(function(plr)
wait(wait(wait()))
print(rs.Funcs:InvokeClient(plr, `getInventory`)) -- the client does return in here but not the other parts wtf
local dataInventory = inventoryStore:GetAsync(plr.UserId..`|`..game.PlaceId) or {}
events:FireClient(plr, `inventory`, dataInventory)
for _, wep in dataInventory do
if not wep[2] then continue end
weapons:FindFirstChild(wep[1], true):Clone().Parent = plr.Backpack
end
end)
It is happening in this script too:
events.OnServerEvent:Connect(function(plr, event)
if event ~= `badgeRewards` then return end
respawnTime = plrs.RespawnTime
local function give(item, id, parent)
parent = parent or weps.Others
if not ownb(id) or table.find(funcs:InvokeClient(plr, `getInventory`), item) then return end -- doesn't fire to client.
-- i've tried this for like an hour I gave up please help nothing works (not remote functions not just waiting no nothing)
_G.clone(item, parent, plr.Backpack) -- same problem on the buy script (line 64), check the last section of inventory -> handler
end
if ownb(92138459916479) then
respawnTime /= 2
if ownb(2092864127843328) then
respawnTime /= 2
if ownb(3017341561704653) then
respawnTime /= 2
if ownb(4022409980214611) then
respawnTime /= 2.01
end
end
end
end
if ownb(860025579394488) then
plr.Character.Humanoid.MaxHealth += 1
end
give(`Bomb`, 549562482551418) -- remains unchanged, just change the function itself
give(`Boombox`, 370478133968418)
give(`RocketLauncher`, 3590641607389542)
end)
The client:
(It has nothing to do with this as it does print the event when the player joins but I will still give the code regardless)
funcs.OnClientInvoke = function(event) -- doesn't fire with Weapons -> System (63) and Badges on server (143), please help.
print(event)
if event == `getInventory` then
return inventory:GetChildren()
elseif event == `equip` then
return equipped < maxEquipment
end
end
For context I’ve done basically everything I can and it wasted me a very long time. I also searched at the internet but it’s quite irrelevant