Advertisement
Sungmingamerpro13

ClickDetector Collect(STORY GAME)

Nov 21st, 2022
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. local LogsValue = game.ReplicatedStorage.LogsFound
  2.  
  3. for i, Wood in pairs(script.Parent:GetChildren()) do
  4. if Wood:IsA("Part") then
  5. local ClickDetector = Wood:FindFirstChild("ClickDetector")
  6.  
  7. ClickDetector.MouseClick:Connect(function()
  8. Wood:Destroy()
  9. LogsValue.Value += 1
  10. end)
  11. end
  12. end
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement