Author Topic: "Invalid script file name"  (Read 1605 times)

"Invalid Script file name" I'm making a weapon and I keep getting this error message, What does it mean?
« Last Edit: December 07, 2015, 07:28:18 PM by BOSSNESSFTW »

Post your code and console log.

People are going to have a harder time trying to help you if you can't describe your issue correctly. If I were to guess, you are using the exec() function on a misspelled file. But I really have no clue without you giving me (us) better hints.

more importantly, the name of the script's file

Name: Weapon_Megapistol

console: Executing Add-Ons/Weapon_Megapistol/server.cs
exec invalid script name Add-Ons/Weapon_Megapistol/Megapistol

i'm too lazy to post pictures

the code is somewhat the same to the default gun's code

and I'm also somewhat new to coding, I know what everything means and what cuases syntax errors but I never had this happen.

You forgot .cs in your exec code.

You forgot .cs in your exec code.

I did exec("./Weapon_Megapistol"); in the server.cs if that's what you mean,

and in console I did: exec("Add-Ons/Weapon_Megapistol/server.cs");

Yeah, when executing scripts you need a .cs at the end, which is what you are missing.

Yeah, when executing scripts you need a .cs at the end, which is what you are missing.

Ahh I see it, thanks viso!

Got the weapon working but it just turns into the regular default gun, why?

Look at the datablocks for "shapeFile", change it to your custom model file path

Look at the datablocks for "shapeFile", change it to your custom model file path

Ok.

Ok.

Yup that's what it was, it was a line of code that I didn't check for, My gun is complete and has no errors, it's pretty bad but it's my first weapon.