I’m relatively new to scripting on Roblox, and I’m trying to add a value to a list, but when I do it returns “ReplicatedFirst.LocalScript:7: attempt to call to a nil value”
I’m not exactly sure why it’s causing an error, here’s the code:
local randomKey
local keys = {}
local numberOfKeys = 0
game.Players.LocalPlayer.PlayerGui:WaitForChild("ScreenGui").Start.MouseButton1Click:Connect(function()
randomKey = math.random(26)
keys.insert(randomKey + 96)
numberOfKeys += 1
print(keys)
end)
