So the title is confusing here's what I mean
This one prints True,True
local ProductFunctions = {
[1] = function(player)
print("player is not a player")
return true
end
};
local handler = ProductFunctions[1];
local player = game.Players:WaitForChild('Roblox');
local s, e = pcall(handler,player)
print(s, e) -- Prints True, true which i want
But if i change up the pcall
local ProductFunctions = {
[1] = function(player)
print("player is not a player")
return true
end
};
local handler = ProductFunctions[1];
local player = game.Players:WaitForChild('Roblox');
local s, e = pcall(function()
handler(player)
end)
print(s, e) -- WONt print true,true prints true,nil

1 comment
I hope my solution helps! :))