Facebook
From Sweet Motmot, 10 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 98
  1. --// Vars
  2. local WS = game:GetService("Workspace")
  3. local ObjectSelection = WS:WaitForChild("ObjectSelection")
  4.  
  5. function Check(v)
  6.  
  7. local function CFC(v)
  8. v:WaitForChild("Nope").Changed:Connect(function(A)
  9. if v.Name ~= "Nope" then
  10. for _,v in pairs (v:GetDescendants()) do
  11. if v:IsA("RemoteEvent") and v.Name == "Event" then
  12. v:FireServer()
  13. end
  14. end
  15. end
  16. end)
  17. end
  18.  
  19. if v.Name == "CashRegister" then
  20. if v:FindFirstChild("SmashCash") then
  21. local Event = v.SmashCash.SmashCash.Event
  22. Event:FireServer()
  23. CFC(v)
  24. end
  25. end
  26. if v.Name == "ATM" then
  27. if v:FindFirstChild("ATM") then
  28. local Event = v.ATM.ATM.Event
  29. Event:FireServer()
  30. CFC(v)
  31. end
  32. end
  33. if v.Name == "Cash" then
  34. if v:FindFirstChild("Cash") then
  35. local Event = v.Cash.Cash.Event
  36. Event:FireServer()
  37. CFC(v)
  38. end
  39. end
  40. if v.Name == "DiamondBox" then
  41. if v:FindFirstChild("SmashCash") then
  42. local Event = v.SmashCash.SmashCash.Event
  43. Event:FireServer()
  44. CFC(v)
  45. end
  46. end
  47. if v.Name == "Safe" then
  48. if v:FindFirstChild("SmashCash") then
  49. local Event = v.SmashCash.SmashCash.Event
  50. Event:FireServer()
  51. CFC(v)
  52. end
  53. end
  54. if v.Name == "SlotMachine" then
  55. if v:FindFirstChild("SlotMachine") then
  56. local Event = v.SlotMachine.SlotMachine.Event
  57. Event:FireServer()
  58. CFC(v)
  59. end
  60. end
  61. end
  62.  
  63. for _,v in pairs (ObjectSelection:GetChildren()) do
  64. Check(v)
  65. end