Advertisement
Dark_EccentricYT

Untitled

Aug 28th, 2020 (edited)
13,602
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. for i, v in pairs(workspace:GetDescendants()) do
  2. if v.Parent.Name == "Up" and v.ClassName == "ClickDetector" then
  3. spawn(function()
  4. while true do
  5. wait()
  6. if v then
  7. fireclickdetector(v)
  8. else
  9. break;
  10. end
  11. end
  12. end)
  13. elseif v.Parent.Name == "On" and v.ClassName == "ClickDetector" then
  14. if v.Parent.BrickColor ~= BrickColor.new("Dark green") then
  15. fireclickdetector(v)
  16. end
  17. v.Parent:GetPropertyChangedSignal("BrickColor"):Connect(function()
  18. if v.Parent.BrickColor ~= BrickColor.new("Dark green") then
  19. fireclickdetector(v)
  20. end
  21. end)
  22. end
  23. end
  24.  
  25. workspace.DescendantAdded:Connect(function(descendant)
  26. if descendant.Parent.Name == "Up" and descendant.ClassName == "ClickDetector" then
  27. spawn(function()
  28. while true do
  29. wait()
  30. if descendant then
  31. fireclickdetector(descendant)
  32. else
  33. break;
  34. end
  35. end
  36. end)
  37. elseif descendant.Parent.Name == "On" and descendant.ClassName == "ClickDetector" then
  38. if descendant.Parent.BrickColor ~= BrickColor.new("Dark green") then
  39. fireclickdetector(descendant)
  40. end
  41. descendant.Parent:GetPropertyChangedSignal("BrickColor"):Connect(function()
  42. if descendant.Parent.BrickColor ~= BrickColor.new("Dark green") then
  43. fireclickdetector(descendant)
  44. end
  45. end)
  46. end
  47. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement