Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

For some reason this always prints the hacker message even though I have enough money?

Asked by 6 years ago

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)

0
There is no error message shankable 9 — 6y
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) Leamir 3138 — 6y

Answer this question