Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I Need Help On My MainModule Script But It Wont Work I Keep Getting The Same Error Can Someone Help?

So To Put It Simple, I Want The MainModule To Be Executed Through A Script From The ServerScriptService Or Workspace, I've Ask A Similar Question Before But I Couldn't Understand What To Do So I Tryed To Fix It, And I Fix One Error Which Was A Table Value But Now I'm Getting The Same Error I Had Before Which Was Argument 1 missing or nil If Someone Could Help Me I Would Appreciate It.

This Is My MainModule Code:

local wow = script 
local script = wow
local module = {}
function module()
    script.oofer_gang:Clone().Parent = game:GetService("Players"):FindFirstChild().PlayerGui
end
return module

Please Help Me Because I Cant Do It And I've Been Trying To Fix This For More That A Few Weeks Now. Thank You.

Output: Argument 1 missing or nil Stack Begin Script 'Model.MainModule', Line 5 Script 'ServerScriptService.Script', Line 2 Stack End

1 comment

0

Please Post The Whole Output So We Can See The Error.

2 answers

✓ Accepted answer

So, basically, the main error here is that you're using FindFirstChild() without the main argument, which in your case is probably PlayerGui.

game:GetService("Players").LocalPlayer:FindFirstChild("PlayerGui")

NOTE: .LocalPlayer gets the current player, you need to use it from a local script.

2 comments

0

i dont want to use a local script tho i want to use a module script so i can execute it as a require

0

hi you still haven't answered my question above. Can You Please Answer, Thanks.

nvm i fixed it the problem was i was sending it to the player not the server so i put it in the starter gui in the code here.

local module = {}
script.oofer_gang:Clone().Parent = game.StarterGui
return module

it was a simple answer, i just over looked it but thanks for your help

This discussion is preserved as it was. New answers, comments, and votes are closed.