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

[ANSWERED] "attempt to index global 'module' (a nil value)"?

local moulue = require(script.Parent:WaitForChild("ModuleScript"))
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

script.Parent.Activated:Connect(function()
	module.Throw()
end)

This was the code can I get some help fixing it?

local module = {}
local replicatedStorage = game:GetService("ReplicatedStorage")

function module.Throw()
	
	replicatedStorage.Remotes.Throw:FireServer()
	
end

return module

This is the module script.

2 comments

0

This looks good, but can you show me what is in the modulescript?

2

Typo on line 1, word 2. Please check these kind of things before asking a question.

1 answer

Nil = nothing , it appears you have spelled module wrong on line 1. The server is telling you module is not a thing, because it is not set by you correctly. You wrote local moulue instead of module

Hope this helps !

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