Advertisement
Guest User

Lumber Tycoon 2

a guest
Nov 11th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. --[[
  2. James's Save Tools On Respawn
  3. After executing the script, please wait until you are able to move your character again.
  4.  
  5.  
  6. this is so simple but some people wanted it
  7. ]]
  8.  
  9. -- Don't edit script unless you know what you're doing. If you wanna add this into a script, please give credits and message me on discord that you added it in a script at James H.#0953
  10.  
  11. local LocalPlayer = game:GetService("Players").LocalPlayer
  12. local function saveTools()
  13. LocalPlayer.Character:WaitForChild("Humanoid").Died:Connect(function()
  14. LocalPlayer.Character:FindFirstChild("Humanoid"):UnequipTools()
  15. for _, tool in pairs(LocalPlayer.Backpack:GetChildren()) do
  16. if tool:IsA("Tool") then
  17. tool.Parent = LocalPlayer
  18. end
  19. end
  20. end)
  21. end
  22. LocalPlayer.CharacterAdded:Connect(function(char)
  23. for _, tool in pairs(LocalPlayer:GetChildren()) do
  24. if tool:IsA("Tool") then
  25. tool.Parent = LocalPlayer.Backpack
  26. end
  27. end
  28. saveTools()
  29. end)
  30. saveTools()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement