Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MainBankScript
- -----------------------
- local debounce = false
- local playerfound = false
- function CreateRegion3FromPart(Part)
- return Region3.new(Part.Position-(Part.Size/2),Part.Position+(Part.Size/2))
- end
- function GetPlayersInPart(part)
- local region = CreateRegion3FromPart(part)
- local partsInRegion = workspace:FindPartsInRegion3(region,nil,math.huge)
- local Players = {}
- for i,Part in pairs(partsInRegion) do
- local player = game.Players:GetPlayerFromCharacter(Part.Parent)
- if player then
- for i, v in pairs(Players) do
- if Players[i].Name == player.Name then
- playerfound = true
- end
- end
- if playerfound == false then
- table.insert(Players,player)
- end
- playerfound = false
- end
- end
- for i, v in pairs(Players) do
- if Players[i].CashCollected.Value < 1500 then
- Players[i].CashCollected.Value = Players[i].CashCollected.Value + 150
- end
- end
- return Players
- end
- while wait(1) do
- GetPlayersInPart(game.Workspace.BankDetector)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement