for those of you who didn’t get the issue, even after assigning self.Config to nil, it still prints ServerInfo(previously stored value) and not nil. Any help would be apricated
Edit: The object in the game is getting destroyed but idk what’s up with this script
sure, Config is a variable that holds an instance (Configuration).
function MatchSystem.New()
local self = setmetatable({}, MatchSystem)
--Step0--
MatchSystem.Config = Instance.new("Configuration", game.ReplicatedStorage)
MatchSystem.Config.Name = "ServerInfo"
MatchSystem.Config:SetAttribute("Step", 0)
game.ReplicatedStorage.RemoteEvent:FireAllClients("New Match", MatchSystem.Config)
for i, v in pairs(game.Workspace:GetChildren()) do
if not table.find(Dictionary.WorkspaceDefault, v) and not v:FindFirstChild("Humanoid") then
v:Destroy()
end
end
task.wait(1)
return self
end
@Twexdy and @dthecoolest, I don’t think that’s the issue in this case.
I tried adding another variable MatchSystem.IDK = false and tried to change it in Match:End() function (self.IDK = true), that worked completely fine. So ya it works for other variables and stuffs but not for MatchSystem.Config.
I was unable to replicate the bug myself but I did notice that you’re using a way to make classes that might be causing the issue. Try doing this instead:
Class = {}
Class.__index = Class
function Class.new()
local self = setmetatable({}, module.Result)
-- code stuff
end