-
I am trying to make it to where when a player buys the object with [“POINTS”], the player who bought the object should not be able to buy it again.
-
The issue is that nothing happens when the player interacts. When I remove the part where it checks if the player is in the table, it works fine but the player can buy the object again.
-
I have tried inserting the player into a table and check if they are in the table to not fire the client.
local function onInteracted()
local Points = ThePlayer.Character:WaitForChild("POINTS")
local AmmoCheck = ThePlayer.Character:WaitForChild("AmmoCheck")
local ReserveCheck = ThePlayer.Character:WaitForChild("ReserveCheck")
if Points.Value >= Price and PlayersBoughtThis[ThePlayer] == false then
Points.Value -= Price
game.ReplicatedStorage.Indigo.SpecialEvents.PurchaseTriggerFinger:FireClient(ThePlayer)
table.insert(PlayersBoughtThis, ThePlayer, true)
Root.Song:Play()
end
if Points.Value <= Price then
print("not enough")
end
end