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

How Do i fix this module script error? (Blank is not a valid member of ModuleScript)

Asked by 5 years ago

ive tried a few things but it still isnt working.. any help will be apritiated (the only thing i can think thats breaking it is the order)

Normal Script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CraftEvent = ReplicatedStorage.CraftEvent
local Module = ReplicatedStorage.Crafting

local function onCraftEventFired(player, Item)

    if Module[Item].C1 == "None" then
        C1 = true
    end
    if Module[Item].C2 == "None" then
        C2 = true
    end

CraftEvent.OnServerEvent:Connect(onCraftEventFired)

Module Script:

local Crafting = {}
Crafting["Blank"] = {
    C1 = "None",
    C2 = "None",
}
return Crafting
1
you forgot to require the module: local Module = require(ReplicatedStorage.Crafting) hellmatic 1523 — 5y
0
lol its always the simple things ForgotenR4 68 — 5y

1 answer

Log in to vote
0
Answered by
Nosteal 50
5 years ago

You forgot to require the modulescript (Normal script)

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CraftEvent = ReplicatedStorage.CraftEvent
local Module = require(ReplicatedStorage.Crafting)

local function onCraftEventFired(player, Item)

    if Module[Item].C1 == "None" then
        C1 = true
    end
    if Module[Item].C2 == "None" then
        C2 = true
    end

CraftEvent.OnServerEvent:Connect(onCraftEventFired)
0
This question has already been answered. Don't attempt to take credit for someone else's answer. User#19524 175 — 5y
Ad

Answer this question