I have been following a youtube tutorial which I’m still trying to learn some of what the coding does because its decently advanced and cam across this issue: Attempted to call require with invalid argument(s):
I have a folder in Starterpack called ModuleScripts which obviously stores much ModuleScripts into:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterPack = game:GetService("StarterPack")
local PunchEffectsEvent = ReplicatedStorage.RemoteEvents:WaitForChild("PunchEffectsEvent")
PunchEffectsEvent.OnClientEvent:Connect(function(...)
local Argument = {...}
local Module = require(StarterPack.ModuleScripts.PunchEffectsModule:FindFirstChild(Argument[1]))
Module[Argument[2]](Argument)
end)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterPack = game:GetService("StarterPack")
local PunchEffectsEvent = ReplicatedStorage.RemoteEvents:WaitForChild("PunchEffectsEvent")
PunchEffectsEvent.OnClientEvent:Connect(function(...)
local Argument = {...}
local RequirePath = StarterPack.ModuleScripts.PunchEffectsModule:FindFirstChild(Argument[1])
print(RequirePath)
local Module = require(RequirePath)
Module[Argument[2]](Argument)
end)
I’d just end up learning scripting from other tutorials and making your own combat system. This entire tutorial is a bit weird and the majority of the comments are either botted or issues with the script
Ok yes. I might as well show you the other script that is connected to this one. I think I may have confused everyone by not showing this ModuleScript:
This is the LocalScript we are talking about now where the issue is and inside the ModuleScript folder is the ModuleWScript and this is whats inside:
local TweenService = game:GetService("TweenService")
local Debris = game:GetService("Debris")
local Meshes = script.Meshes
local PunchEffectsModule = {}
function PunchEffectsModule.Effects(Argument)
local Folder = Instance.new("Folder")
Folder.Name = "PunchEffects"
Folder.Parent = workspace
Debris:AddItem(Folder, 1)
coroutine.wrap(function()
for Index = 1, 12 do
local Sphere = Meshes.Sphere:Clone()
Sphere.Size = Vector3.new(0.1, 0.1, 0.1)
Sphere.CFrame = Argument[3].CFrame * CFrame.Angles(math.rad(math.random(-180, 180)), math.rad(math.random(-180, 180)), math.rad(math.random(-180, 180))) * CFrame.new(0, 0, -0.5)
Sphere.Parent = Folder
Debris:AddItem(Sphere, 0.25)
TweenService:Create(Sphere, TweenInfo.new(0.25), {CFrame = Sphere.CFrame * CFrame.new(0, 0, -10)}):Play()
TweenService:Create(Sphere, TweenService.new(0.125), {Size = Vector3.new(0.2, 0.2, 5)}):Play()
task.delay(0.125, function()
TweenService:Create(Sphere, TweenService.new(0.125), {Size = Vector3.new(0.1, 0.1, 0.1), Transparency = 1}):Play()
end)
end
end)()
end
return PunchEffectsModule