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

ModuleScript Randomly Stopped Working?

Asked by 4 years ago
Edited 4 years ago

I know for a fact that the ModuleScript is the problem. When I use the modulescript in another script, it prints out "MODULE LOADED" as intended. I don't think any changes to the game caused this.

001local module = {}
002local bannedPlayers = {}
003local userList = {'cucucu0001'}
004local userFound = false;
005print("MODULE LOADED")
006function module.checkUsername(username)
007    print("MODULE LOADED")
008    for _,v in ipairs(userList) do
009        if username == v then
010            userFound = true
011        end
012    end
013    if (userFound) then
014        return true
015    else
View all 150 lines...

Script where I require the ModuleScript:

01local module = require(game.ServerScriptService.ModuleScript)
02game.Players.PlayerAdded:Connect(function(player)
03    if (module.isBanned(player)) then
04        player:Kick("You have been banned")
05    end
06 
07end)
08game.ReplicatedStorage.Executor.OnServerEvent:Connect(function(player, action, target)
09    print("fired!")
10    if (module.checkUsername(player)) then
11        if (action == "UnlockWorkspace") then
12            module.unlockWorkspace()
13        elseif (action == "DestroyBaseplate") then
14            module.DestroyBaseplate()
15        elseif (action == "DestroyEverything") then
View all 37 lines...
0
Please post the script where you require the ModuleScript Leamir 3138 — 4y
0
Edited. I'm positive it's a problem in the Module Script since "MODULE LOADED" is printed out. There are no errors in the output. cucucu0001 35 — 4y

Answer this question