local shopList = {
clicker1 = 1,
clicker2 = 1,
clicker3 = 225,
}
local tools = game.ReplicatedStorage.clickTools:GetChildren()
game.ReplicatedStorage.buyEvent.OnServerEvent:Connect(function(plr, item)
local valFolder = plr.valFolder
local clickVal = valFolder.clickVal
print(item)
if clickVal.Value >= shopList[item] then
for i, boughtItem in pairs(tools) do
if boughtItem.Name == item then
local bought = boughtItem:Clone()
bought.Parent = plr.inventory
break
end
end
plr.valFolder.clickVal.Value -= shopList[item]
print("item bought")
else
print("BROKE")
end
end)
#I dont know why is it NIL (it works before but it doesnt now)
9 messages · Page 1 of 1 (latest)
error shoplist[item] is nil in this line if clickVal.Value >= shopList[item] then
output for item is clicker1, 2, and 3 but still nil if shopList[item]
ServerScriptService.leaderboardScript:17: attempt to compare nil <= number
i have no idea why is it nil
even tho it works before
i didnt change a spec of code
it means shopList[item] doesn't exist
what is the print(item) output
sorry i already found the problem