Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

2 comments

1

you forgot to require the module: local Module = require(ReplicatedStorage.Crafting)

0

lol its always the simple things

1 answer

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)

1 comment

0

This question has already been answered. Don't attempt to take credit for someone else's answer.

This discussion is preserved as it was. New answers, comments, and votes are closed.