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

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

Asked by
acluh 0
4 years ago
Edited 4 years ago
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.

0
This looks good, but can you show me what is in the modulescript? gloveshun 119 — 4y
2
Typo on line 1, word 2. Please check these kind of things before asking a question. RubenKan 3615 — 4y

1 answer

Log in to vote
0
Answered by
AltNature 169
4 years ago
Edited 4 years ago

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 !

Ad

Answer this question