Player.GiveItemByServer = function(PLR, Item, Amount)
local BackpackEvent = game.ReplicatedStorage.ToolsM.Backpack
BackpackEvent:FireClient(game.Players.ZINTICK, Item, Amount)
print(PLR.Character) -- nil
if (PLR.Character:FindFirstChild(Item) and
^Gives error
PLR.Backpack:FindFirstChild(Item)) == nil then
local c = game.ServerStorage.Usables:FindFirstChild(Item):Clone()
c.Parent = PLR.Backpack
end
end
Is it running before ZINTICK has actually loaded into the server? There’s usually at least a few seconds between the server script running and the Player actually joining the server.
You could try using a :WaitForChild()?
Also is there a reason you’re not using the PLR argument in your :FireClient function, rather than indexing the Player directly by name?
Are you running this script as soon as the server starts, if so the issue is the script is running before the character exists. I did some debugging and the script worked fine for me when I added this line:
repeat wait() until PLR.Character
This isn’t exactly optimal so what I’d do instead is make sure the player has a character when you’re calling the module