So I am making my customizable and editable admin commands and the way I do it is by anonymous functions. However I always want there be a way to get a player or a team so I turn them back to regular functions but that gives me an error.
The error is:
CommandsModuleScript:106: Expected '(' when parsing function, got 'GetPlayer'
Here's the anonymous function that was correct back then:
function(PlayerChatted, ReformedSplices) -- print("Executed") if TeamsService:FindFirstChild(ReformedSplices[1]) then return {TeamsService:FindFirstChild(ReformedSplices[1])} end return nil end,
Here's the regular function that is somehow incorrect:
function GetPlayer(PlayerChatted, ReformedSplices) -- error happens here print("Executed") if TeamsService:FindFirstChild(ReformedSplices[1]) then return {TeamsService:FindFirstChild(ReformedSplices[1])} end return nil end,
The functions both have other anonymous functions above them inside of a table to keep things organized but I'm not sure why it causes that error. The error seems like it wants to become an anonymous function but I'm not too sure.