Still have questions? Join our Discord server and get real time help.
1

# how do i make it so that people dont loose there item?

Asked by 3 months ago

this works in the way that the player gets the item and when he/she resets/dies they will get it in there inventory and what doesn't work is that other players when they die the item stays in server storage and its a problem when it leaves the inventory, in general, how would I fix this thank you

local gamepassid_ = 10022825
local b = game:GetService("ServerStorage"):FindFirstChild("GravityCoil"):Clone()

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 10022825) then
if player.Backpack:FindFirstChild("GravityCoil") == nil then
game.ServerStorage:FindFirstChild("GravityCoil"):Clone()
b.Parent = player.Backpack
end
end
end)

character:WaitForChild("Humanoid").Died:Connect(function()
b:clone()
game:GetService("ServerStorage"):FindFirstChild("Gravitycoil"):clone()
wait(5.2)
print(gamepassid_)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 10022825) then
if player.Backpack:FindFirstChild("GravityCoil") == nil then
game.ServerStorage:FindFirstChild("GravityCoil"):Clone()
b.Parent = player.Backpack
end
end
end)

end)
end)

0
remove the .Died inside characteradded Subsz 366 — 3mo

1
Answered by 3 months ago

Players have a .StarterGear which holds items that they spawn with. So you could do;

local gamepassid_ = 10022825
local b = game:GetService("ServerStorage"):FindFirstChild("GravityCoil"):Clone()