Very fast question

This: >= is ‘greater than or equal to’
doesn’t seems to work proberly for me, am I doing it wrong?

Where are you using it? What’s the context, what’s the code?

nvm it works now, but is there somehow I can make variables not being able to decrease under 0?

Variable = math.Clamp(Variable, 0, 9999)

Did this: stamina = math.Clamp(stamina, 0, 9999)
though it still seems to decrease under 0.

You need to clamp it each time you change it.

[lua]
function staminaDrain()
timer.Create( “MinusStamina”, 1, 0, function()
if running == true then
stamina = math.Clamp(stamina, 0, 9999)
stamina = stamina - CFGstaminaloss
if stamina == 0 then
RunConsoleCommand( “stamina_out” )
staminaSpeed()
end
end

	if running == false then
		timer.Stop( "MinusStamina" )
	end
end)
timer.Start( "MinusStamina" )

end
[/lua]

it goes down to -5 and stops, like it is the limit. Though I want it to stop at 0.

Clamp it after you change it,
or better yet, clamp it at the same time:
[lua]

function staminaDrain()
timer.Create( “MinusStamina”, 1, 0, function()
if running == true then
stamina = math.Clamp(stamina - CFGstaminaloss, 0, 9999)
if stamina == 0 then
RunConsoleCommand( “stamina_out” )
staminaSpeed()
end
end
if running == false then
timer.Stop( “MinusStamina” )
end
end)
timer.Start( “MinusStamina” )
end[/lua]

Awesome, it works. Thanks!

Edit;

Last question, how do I send a variable to the server/init?

You can use the new net library if you have GMod13 ( read up about it at wiki.garrysmod.com, the link is on the front page ).

Or, you can use commands, but it isn’t a very good idea because they could be exploited. If you don’t have gmod 13 and wish to use the net library, I will hapilly test your code for you.

Well, I’m not using GMod13 and I know it’s bad to use concommands.

Concommands is the only way for client->server communication without the net library.

Hmm all right, nothing to do about it then.

There will always be ways for people to send information you otherwise wouldn’t want them to. That means you have to validate the stuff that comes to the server, so he can’t for example try to buy a car from a cardealer that’s 1000 units away.

Yeah, I understand I can probably just do a workaround.

As a general rule of thumb, the alligator always eats the bigger number.