generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Call require with invalid arguments?

Previous Thread :: Next Thread 
AetherShotgun is not online. AetherShotgun
Joined: 17 Mar 2014
Total Posts: 656
03 Apr 2014 10:15 PM
Output: Attempted to call require with invalid argument(s).

local req = require(game.Workspace.RequireThis)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Apr 2014 10:18 PM
make sure that workspace.RequireThis exists and is a modulescript
Report Abuse
AetherShotgun is not online. AetherShotgun
Joined: 17 Mar 2014
Total Posts: 656
03 Apr 2014 10:21 PM
Heh, had it in a normal script... sadly error'd again.

Requested module experienced an error while loading
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Apr 2014 10:23 PM
Post the script you currently have
Report Abuse
AetherShotgun is not online. AetherShotgun
Joined: 17 Mar 2014
Total Posts: 656
03 Apr 2014 10:26 PM
Access point:
local req = require(game.Workspace.RequireThis)

How I run it:
req.sayHello()

moduleScript:
local funcTable = { }
function funcTable:sayHello()
print("Hello World")
end

Output:
Requested module experienced an error while loading
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Apr 2014 10:27 PM
return funcTable in the module script at the bottom
Report Abuse
AetherShotgun is not online. AetherShotgun
Joined: 17 Mar 2014
Total Posts: 656
03 Apr 2014 10:28 PM
so this...?
local funcTable = { }
function funcTable:sayHello()
print("Hello World")
return funcTable
end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Apr 2014 10:29 PM
no, at the end of the script. Not function
Report Abuse
AetherShotgun is not online. AetherShotgun
Joined: 17 Mar 2014
Total Posts: 656
03 Apr 2014 10:30 PM
Oh... well thanks, seems to work now. All praise lord cntkillme, my forever lover!
Report Abuse
AetherShotgun is not online. AetherShotgun
Joined: 17 Mar 2014
Total Posts: 656
03 Apr 2014 10:36 PM
Now I added to arguments...

req.sayHello(one, two)

...and it says two is a nil value...
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Apr 2014 10:38 PM
you call a method like:
req:sayHello(one, two)
or
req.sayHello(req, one, two)
Report Abuse
AetherShotgun is not online. AetherShotgun
Joined: 17 Mar 2014
Total Posts: 656
03 Apr 2014 10:43 PM
Thanks, now it works even with the args. :)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image