I would like to find out how to access the backpack in a script in ServerScriptService
This was weird. It works on my other games, but not this one.
So my script is just a function that gives the player a sword. The issue is that it can’t find “Backpack”
The script i use was almost identical to a script i used before, and the script I used before worked, but this one didn’t. (it’s not exactly the same, i had to change it up for my game.)
Script:
function CloneTool(player, object)
local Backpack = player:FindFirstChild("Backpack")
if game.ReplicatedStorage.Tools:FindFirstChild(object) then
local c = game.ReplicatedStorage.Tools:FindFirstChild(object):Clone()
c.Parent = Backpack
end
end
wait(2)
CloneTool("Sword")
No matter how I format it, I tried doing
game.Players.LocalPlayer.Backpack
but that still didn’t work. There always seems to be a problem with finding the backpack and nothing else. I looked on the devhub, and I still couldn’t find anything. I just need another way to access the backpack, because the usual way I do it doesn’t work.
this is the error, It just can’t find the backpack for some reason. Thanks in advance.