Alright so, I am currently trying to work on a module script that I am making myself, but I am struggling with the attempt to call a nil value right now.
I don’t see any problems at all and I don’t know how to completely fix it.
Modulescript:
-- Basically, takes all remotes that are listed on Folder.
local RemoteEffectsFolder = game.ReplicatedStorage.RemoteEffectsFolder
local DamageEffectsFolder = RemoteEffectsFolder.DamageEffectsFolder
local MoveEffectsFolder = RemoteEffectsFolder.MoveEffectsFolder
-- Location of super amazing effects!!!
local EffectsLocation = workspace.ignore
-- Services.
local TweenService = game:GetService("TweenService")
local Debris = game:GetService("Debris")
local effects = {}
-- Damage1
function effectsDefaultDamage(Character)
local Effect1 = game.ServerStorage.PackageFolder.EffectsFolder.VFXFolder.Sphere:Clone()
Effect1.Parent = EffectsLocation
Effect1.Size = Vector3.new(6,2,6)
Effect1.CFrame = Character.Torso.CFrame * CFrame.new(math.random(0,0.2), -0.1, math.random(0,0.2)) * CFrame.Angles(math.random(-360, 360), math.random(-360, 360), math.random(-360, 360))
Effect1.Color = Color3.fromRGB(255, 55, 55)
Effect1.Transparency = 0.85
Debris:AddItem(Effect1,1.5)
local Info = TweenInfo.new(1.5,Enum.EasingStyle.Cubic,Enum.EasingDirection.Out)
local tween = TweenService:Create(Effect1,Info,{Effect1.Size + Vector3.new(2,2,2)})
tween:Play()
end
return effects
For executing. EffectsModule.effectsDefaultDamage(v)
05:35:16.482 Players.scribblestack.Backpack.Demolish.Script:43: attempt to call a nil value - Server - Script:43
05:35:16.483 Stack Begin - Studio
05:35:16.483 Script ‘Players.scribblestack.Backpack.Demolish.Script’, Line 43 - Studio - Script:43
05:35:16.483 Stack End - Studio
A module works by having the functions in the table that is returned. You must put “effects.” before your function name to solve the problem. It will add it to the table so you reference it properly and don’t reference a nil value.
Could’ve been more nice if you just included the code, just saying. I really don’t mostly get what are you saying or most because that I don’t do programming talk.
EffectsModule is on ReplicatedStorage to folder called “ModulesFolder”. local EffectsModule = require(game.ReplicatedStorage.ModulesFolder.EffectsModule)
Assuming this is calling the module script you supplied above, and you supplied the entirety of the script, then you don’t have something called effectsDefaultSlash. You do have an effectsDefaultDamage, though it’s not included in the returned effects