You can Add A Remote Event In ReplicatedStorage and Call It ReToolGive.
This should be A LocalScript in StarterPlayer → StarterPlayerScripts
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character -- Waits Until Character Loads In
local Humanoid = Player.Character:WaitForChild("Humanoid")
Humanoid.Died:Connect(function()
game.ReplicatedStorage.ReToolGive:FireServer() -- Fire the Remote
end)
Now This Should be A Script In ServerScriptService.
game.Players.PlayerAdded:Connect(function(Player)
local Folder = Instance.new("Folder")
Folder.Name = Player.Name .. "Tools"
Folder.Parent = game.ServerStorage
end)
game.ReplicatedStorage.ReToolGive.OnServerEvent:Connect(function(Player)
for i, v in pairs(Player:WaitForChild("Backpack"):GetChildren()) do
if v:IsA("Tool") then
v.Parent = game.ServerStorage:FindFirstChild(Player.Name .. "Tools") -- Parents to A Folder
end
end
for i, v in pairs(Player.Character:GetChildren()) do
if v:IsA("Tool") then
v.Parent = game.ServerStorage:FindFirstChild(Player.Name .. "Tools") -- Parents to A Folder
end
end
Player.CharacterAdded:Connect(function() -- Respawns
for i, v in pairs(game.ServerStorage:FindFirstChild(Player.Name .. "Tools"):GetChildren()) do
v.Parent = Player:WaitForChild("Backpack") -- Parents it Again
end
end)
end)
I’d just reference cloning the Tools inside ServerStorage instead, you can still put them inside StarterPack but make sure to duplicate a pack & put it in ServerStorage
game.ReplicatedStorage.ToolEvents.GrenadeEvent.OnServerEvent:Connect(function(player)
if player.leaderstats.Cash.Value >= 50 then
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - 50
game.ServerStorage.Tools.Grenade:Clone().Parent = player.Backpack
end
end)