Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
Edited 5 years ago

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

0
Please Post The Whole Output So We Can See The Error. Jahaziel_VanDerHas 238 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

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.

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 mahid786 41 — 5y
0
hi you still haven't answered my question above. Can You Please Answer, Thanks. mahid786 41 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

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

Answer this question