"Expected identifier when parsing expression, got malformed string"
Here is the whole script:
local RemoteEvents = game.ReplicatedStorage:WaitForChild("RemoteEvents")
local AbilityEvents = RemoteEvents:WaitForChild("AbilityEvents")
--Events--
local FireballEvent = AbilityEvents:WaitForChild("Fireball")
local RockEvent = AbilityEvents:WaitForChild("EarthBasic")
local StoneMod = require(script:WaitForChild("StoneAttackModule"))
local FireballMod = require(script:WaitForChild("FireballAttackModule"))
RockEvent.OnClientEvent:Connect(function(plr, MousePos, Speed, Size)
StoneMod.BasicAttack(plr, MousePos, Speed, Size)
end)
FireballEvent.OnClientEvent:Connect(function(plr, MousePos, Speed, Size)
FireballMod.ShootBall(plr, MousePos, Speed, Size)
end)
This error is stopping the whole script from working and I have no idea what parsing is or what a “malformed string” is…
For context: I have a local script which waits for a remote event which is fired to all clients. The local script has to module scripts in it. The first handles the graphics to a rock attack and the second handles graphics to the fireball attack.
Btw the rock module script works fine, the script just gets stuck on requiring the fireball module. If you need the fireball module script to help me, please ask and i’ll post it in the comments because its pretty long.
The issue is with requiring the module. Also I forgot to mention that the code works in a solo test but not in a team test. Maybe there is bad data but where would I put the prints?
Yes, when a module script encounters an error, then it will say that it experienced an error while loading, and cannot be requested.
Considering that it doesn’t work in team tests, maybe it could be to do with firing the wrong client, or something? Please try to add some print()s to see if we are getting bad data.
Well the script does not continue so the prints you suggested didn’t work, so I added the prints to the server script which fires the data to all clients and the data there is correct.
I’ve had to spoof it a little, but the script works for me?
Double check all of the variables at the top are correctly names, otherwise I’ll try some more things out.
If fire aoe module is under this module, it should work perfectly fine, but if its parent is root script, you will have to consider adding “.Parent” right after script keyword
Just made a new module script, copied all the old code and pasted it into a fresh script and it worked! Thanks for the help even if the solution was pretty disappointing.