i'm working on a call of duty: zombies remake and everything works fine in singleplayer but when in multi-player buying a weapon causes all players in game to buy it too - i want it so the person that buys the weapon is the only one who pays for it and also is the only one who receives it
local ProximityPrompt = script.Parent.PromptAttachment.ProximityPrompt
upgradecost = 1000
ProximityPrompt.Triggered:Connect(function(player)
local p = game.Players:GetChildren()
for i = 1, #p do
local cash = p[i].leaderstats:findFirstChild("Points")
if (p[i].Name ~= script.Owner.Value) then
if cash.Value > upgradecost or cash.Value == upgradecost then
script.Parent.Reload:Play()
game.Lighting:findFirstChild("Sawn-off"):clone().Parent = p[i].Backpack
cash.Value = cash.Value - upgradecost
end
end
end
end)
