I'm trying to make a bigger duffel bag gamepass. Here is what my script for money giving looks like :
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].Robbing.Value == false then
game.ReplicatedStorage.ShowRobberyGUI:FireClient(Players[i])
end
Players[i].Robbing.Value = true
if Players[i].CashCollected.Value < 1000
then
Players[i].CashCollected.Value = Players[i].CashCollected.Value + 10
end
end
return Players
end
while wait(0.2) do
GetPlayersInPart(game.Workspace.Detector)
end
I'm trying to make it so if the player has the Bigger Duffel Bag gamepass [https://www.roblox.com/library/1607774359/Bigger-Duffel-Bag-PRE-ORDER] he will get 3.5k money instead of 1k. Would appreciate some help.

4 comments
This does not seem to work. Could you please put it in the whole script and make it the whole script so i can directly copy and paste the script? Thanks.
I edited the post try copy pasting that.
Still doesn't work. I don't think we make this work.
It may be because I had it as "Player[i]" Instead of "Players[i]" try it again I fixed it.