Advertisement
Sungmingamerpro13

Touched Collect Wood

Aug 14th, 2022
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. script.Parent.Touched:Connect(function(Hit)
  2. if Hit.Parent:FindFirstChild("Humanoid") then
  3. local player = game.Players:GetPlayerFromCharacter(Hit.Parent)
  4. local Wood = player.Character:FindFirstChild("Wood")
  5.  
  6. if Wood then
  7. Wood:Destroy()
  8. game.ReplicatedStorage.WoodsFound.Value += 1
  9. print(player, "Has Found a Wood")
  10. end
  11. end
  12. end)
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement