Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- function OnPlayerAdded(Player)
- local SavedTools = {}
- local function OnCharacterAdded(Character)
- for Index, Tool in pairs(SavedTools) do
- Tool.Parent = Player.Backpack
- end
- SavedTools = {}
- local function OnDied()
- for Index, Tool in pairs(Player.Backpack:GetChildren()) do
- local CopiedTool = Tool:Clone()
- table.insert(SavedTools, CopiedTool)
- end
- for Index, Tool in pairs(Player.Character:GetChildren()) do
- if Tool:IsA("Tool") then
- local CopiedTool = Tool:Clone()
- table.insert(SavedTools, CopiedTool)
- end
- end
- end
- Character.Humanoid.Died:Connect(OnDied)
- end
- Player.CharacterAdded:Connect(OnCharacterAdded)
- end
- for Index, Player in pairs(Players:GetChildren()) do
- OnPlayerAdded(Player)
- end
- Players.PlayerAdded:Connect(OnPlayerAdded)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement