I am making a zombie survival game that you need to loot for stuff, but if you die you lose all of your loot.
Im having a problem on making so if you leave the game you drop all of your stuff too, i tried to put the script in different places such as StarterPlayerScripts and Workspace but it didn’t work…
heres an example of it:
game.Players.PlayerRemoving:Connect(function(plr)
print(plr.Name…" left")
local Humanoid = plr.Character.Humanoid
local backpack = plr.Backpack
repeat
local tool = backpack:FindFirstChildWhichIsA(“Tool”)
Humanoid:UnequipTools()
tool.Parent = game.workspace
tool.Handle.CFrame = humanoid.Parent.HumanoidRootPart.CFrame
until
tool == nil
end)