game.ReplicatedStorage.backpack.OnServerEvent:connect(function(plr,Message,cost) local cash = plr.Wallet

if not Message then

    print("Invalid Item")

    return
end
if cash.Value < 1 then return end
	print("hello hacker")
if cash.Value < cost then return end

if cash.Value >= cost then
	local serverStorage = game:GetService("ServerStorage")

	local pack = serverStorage.Tools:WaitForChild(Message):Clone()

	local cash = plr.Data.Wallet
	pack.Parent = plr.Backpack
end

end)

2 comments

0

There is no error message

0

The 'print("hello hacker")' isn't on a if, so it will be print every time the script runs(if player have more than 1)