So, I am doing a simulator game. After 7 spent hours I didn’t do anything.
Console is giving me errors whole time. I want to detect if player joins, is his backpack full?
I think the error is not needed for this. But here is the code (I spent some time to be a Member, I am 100% newbie and i don’t know how to get the code “font”)
local player = game.Players:GetFullName()
print(player)
print("1")
print("2")
wait(10)
if player.leaderstats.Coins.Value == script.Capacity.Value then
print("3")
repeat
player.leaderstats.Coins.Value = -1
print("4")
until player.leaderstats.Coins.Value < script.Capacity.Value
else if player.leaderstats.Coins.Value > script.Capacity.Value then
repeat
player.leaderstats.Coins.Value = -1
print("4")
until player.leaderstats.Coins.Value < script.Capacity.Value
end
end
backpackCapacity()
function backpackCapacity()
print("2")
wait(5)
if player.leaderstats.Coins.Value == script.Capacity.Value then
print("3")
repeat
player.leaderstats.Coins.Value = -1
print("4")
until player.leaderstats.Coins.Value < script.Capacity.Value
end
backpackCapacity()
end
backpackCapacity()
I made leaderstats folder inside every player, Coins, Money inside it.
UPDATE: error here:
17:34:42.899 Workspace.Backpack:8: attempt to index nil with ‘Coins’ - Server - Backpack:8
17:34:42.899 Stack Begin - Studio
17:34:42.899 Script ‘Workspace.Backpack’, Line 8 - Studio - Backpack:8
17:34:42.899 Stack End - Studio
Also, if is here someone REALLY good person, you can add me on discord: luky#7348
AND if you help on discord, and if you want more help to me, I can send small amount of Robux.
I appreciate every help or comment!
THANKS FOR EVERYTHING!