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

Module code did not return exactly one value???

Asked by 4 years ago

Here is module script:

01CommandFunctions = {}
02function CommandFunctions.Speed(Player, Speed)
03    Player.Character.Humanoid.Speed = Speed
04end
05function CommandFunctions.Health(Player, Health)
06    Player.Character.Humanoid.MaxHealth = Health
07end
08function CommandFunctions.Heal(Player)
09    Player.Character.Humanoid.Health = Player.Character.MaxHealth
10end
11function CommandFunctions.God(Player)
12    Player.Character.Humanoid.MaxHealth = math.huge
13    Player.Character.Humanoid.Health = Player.Character.MaxHealth
14end
15function CommandFunctions.UnGod(Player)
View all 38 lines...

Here is exact errors:

117:55:47.169 - Module code did not return exactly one value
217:55:47.169 - Requested module experienced an error while loading
317:55:47.169 - Stack Begin
417:55:47.170 - Script 'Workspace.Goon's Admin', Line 2
517:55:47.170 - Stack End
0
I think you can only return functions on mudules Leamir 3138 — 4y
0
This is the wrong script. Fifkee 2017 — 4y

1 answer

Log in to vote
1
Answered by
Vid_eo 126
4 years ago
Edited 4 years ago

You're returning CommandList instead of CommandFunctions, which you defined at the start of the script. Instead of return CommandList, do return CommandFunctions.

1return CommandFunctions --at the end of the script

If you want to access CommandList from other scripts, you can define CommandList as

1CommandFunctions.CommandList = {}--insert table here

If this helps, please accept it as the answer!

Ad

Answer this question