the autocollect: ON button works, but the autocollect: OFF does not. I am using a zednov's tycoon kit but i customized it so that i can autocollect. the snippet from the tycoon core:
--Parts that fall into the collector(s) get processed for i,v in pairs(script.Parent.Essentials:GetChildren()) do if v.Name == "PartCollector" then v.Touched:connect(function(Part) local player = script.Parent.Owner.Value if Part:FindFirstChild('Cash') then if script.Parent.Parent.Parent.AutoCollect.Value == true then game.ServerStorage.PlayerMoney:FindFirstChild(player.Name).Value = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name).Value + Part.Cash.Value elseif script.Parent.AutoCollect.Value == false then Money.Value = Money.Value + Part.Cash.Value end Debris:AddItem(Part,0.1) end end) end end
the snippet from the GUI(which seems to be working but just putting it in here to be sure):
script.Parent.MouseButton1Click:Connect(function(fart) game.Workspace.HafrewsTycoonKit.AutoCollect.Value=false script.Parent.Parent.Autocollect.Text=("Autocollect:Off") end)
please help me, and an advance THANK YOU!!!
I dont know if this will work, but try making the value false (Add an extra line):
--Parts that fall into the collector(s) get processed for i,v in pairs(script.Parent.Essentials:GetChildren()) do if v.Name == "PartCollector" then v.Touched:connect(function(Part) local player = script.Parent.Owner.Value if Part:FindFirstChild('Cash') then if script.Parent.Parent.Parent.AutoCollect.Value == true then script.Parent.Parent.Parent.AutoCollect.Value = false game.ServerStorage.PlayerMoney:FindFirstChild(player.Name).Value = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name).Value + Part.Cash.Value elseif script.Parent.AutoCollect.Value == false then Money.Value = Money.Value + Part.Cash.Value end Debris:AddItem(Part,0.1) end end) end end