Self not working properly

Hello, can someone please help me with self not working properly. Let me know if I need to show anything else. I’ve been looking at the code over and over and cannot figure it out

Sorry if I’m also not understanding something, I’m still learning coding.

CODE:


local Assets = script.Parent.Assets
local Workspace = game:GetService("Workspace")
local WorkspaceAssets = Workspace:FindFirstChild("Game")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local GameSettings = require(ReplicatedStorage.GameSettings)
local GameInfo = ReplicatedStorage.Game


local GameHandler = {}
GameHandler.__Index = GameHandler

function GameHandler.New(Players)
	local self = setmetatable({}, GameHandler)
	self.Players = Players
	self.Plates = nil
	return self
end


Switch these around:

local self = setmetatable(GameHandler, {})
2 Likes

Such a simple fix! It happens to me a lot because I can’t remember where it goes.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.