So I have this table here:
local GodlyItems = {
Items.SL;
Items["Night Eye"]
}
So I try running this:
while rerun==true do
rerun = false
arghh = math.random(1,1)
if arghh == 1 then
randomnumber = math.random(1,godlyamount)
local thonk = GodlyItems[randomnumber]
print("[GODLY!] "..thonk.Name.." was the selected item!")
ItemName.Text = ("[GODLY!] "..GodlyItems[randomnumber].Name.." - ".. GodlyCosts[randomnumber].." Coins")
ItemName.Text = (GodlyItems[randomnumber].Name.." - ".. GodlyCosts[randomnumber].." Coins")
ItemImage.Image = ("rbxassetid://"..GodlyItemImages[randomnumber])
BuyButton.Visible = true
i = GodlyItemTimes[randomnumber]
else
... continued
But for some reason, I get this error:
20:13:54.079 - Players.StolenLimited.PlayerGui.Guis.LocalScript:136: attempt to index local 'thonk' (a nil value)
20:13:54.081 - Stack Begin
20:13:54.082 - Script 'Players.StolenLimited.PlayerGui.Guis.LocalScript', Line 136
20:13:54.083 - Stack End
Line 136 is this:
print("[GODLY!] "..thonk.Name.." was the selected item!")
Can anyone figure out why it's nil?
