local RS = game:GetService("ReplicatedStorage")
local BuyItem = RS.Events.BuyItem
local ServerStorage = game:GetService("ServerStorage")
--In a Table--
local shopItems = {
ClassicSword = {
Tool = game.ServerStorage.Items.ClassicSword,
Price = 500
},
RainbowMagicCarpet = {
Tool = game.ServerStorage.Items.RainbowMagicCarpet,
Price = 2000
},
}
--BuyItem
BuyItem.OnServerEvent:Connect(function(player,item)
local backpack = player:WaitForChild("Backpack")
if shopItems[item] and backpack then
if
player.Money.Value >=shopItems[item].Price then
shopItems[item].Tool:Clone().Parent = backpack
player.Money.Value = player.Money.Value -shopItems[item].Price
print("Purchased Item!")
else
print("Purchase failed!")
end
end
end)
So I just started learning remote events and stuff, anyways, I've been working on this BuyItem remote and I'm wondering if this is safe enough to stop most exploiters or do I need to add more security?

1 comment
A way I like to check is by trying to exploit it using a localscript.