I somehow messed up my gamemode and Im not even sure how.

So I wanted to make a deathmatch game mode and I have a problem.
The player is an error and a failure just like my entire existence.

Where have I messed up?
Here is the code…

cl_init

init

shared

teamsetup

My day has been very bad and to be fair it could not get much worse so I tough I might as well come back and ask facepunch one more time, someone might help.

Right here:



self:SetModel( "model/player/Group03m/Male_0" .. math.random(1,9) .. ".mld" )


You have “.mld”.

It’s supposed to be “.mdl”.

Still did not work.

Now I get this error



function GM:PlayerConnect( string name, string ip)
end


You don’t need to define variable types in LUA.
Change to:



function GM:PlayerConnect(name, ip)
end

Also:

[lua]function ply:SetUpTeam( tm )
if ( not teams[tm] ) then return end
self:SetTeam ( tm )
self:SetModel( “model/player/Group03m/Male_0” … math.random(1,9) … “.mdl” )
end[/lua]

Variable names can not be pure numeric; they must at least start with a character. Your prototype for the function and its body however used a hardcoded ‘1’ which isn’t the way you want that to work.

Still does not work, here are the files.

Team setup

shared

init

I don’t think you got what I was saying exactly. When you’re CALLING the functions, you can use hard values. ply:SetUpTeam(1) is fine when you CALL it inside GM:PlayerSpawn. DEFINING the function is where you want variable names, not hard values.

[lua]team.SetUp( 1, “Survivors”, Color( 255, 0, 0 ) )[/lua]
Is fine.

[lua]teams[1] = {
name = “Survivors”,
color = Vector (1.0. 0, 0),
weapons = {} }[/lua]

Is fine also.

Alright changed those.
Still gives me an error, its already 1am so if you dont mind Ill just leave a link to the gamemode files instead of just copy pasting every single file.
Here it is

Anyways thanks for helping me even tho I know little about lua.
I think this might be the first time iv made a facepunch post about lua and did not get called names :blaze:

You have a console command in your code probably breaking your initialization:



mp_falldamage 1


Lol, why so hard on your self? You don’t need to feel bad about posting to FP. How do you think everyone else got better? Everyone asks questions at some point.

-snip- Nevermind.

Well I was having a bad day yesterday.
Lots of new problems, im feeling much well today and im gonna work hard to make this gamemode work.

[editline]9th August 2017[/editline]

Where do I put commands?

Also Iv got this error now

Changed ™ to (1) but still gives me that error