• GMod Lua - Gamemode Help! Last man wins
    9 replies, posted
-
We are not going to make things for you for free. If you need something made I suggest you go to scriptfodder and create a job. This is a developer section we will help you if you show us some code or problems you are having but we will not spoon feed you.
-
A simple way would be timer.Create, with a few timer stops whenever win conditions are met. I know there are better ways, but this worked for me
yes, but where did i do write the code and how can i spawn the players after the countdown and before they are spectating or waiting
I think you're trying to do complex things without understanding the basics first - I know it might be boring but you cannot just jump into whole gamemodes unless you have the right mindset You'll want to write the code in an init or shared file inside your gamemode - if you don't know what that means, then look at an existing one for help Some advice: - You can spawn players by calling :Spawn() on the entity - You can get a count of all players by using #player.GetAll() - Use a variable in a timer to start the round, then keep track of the round number to decide that variable (aka if it's less than one, variable is 30 seconds otherwise make it 10 or whatever) - Create a timer on round start that runs a function to loop through players, get the alive count then round end if only one is alive
I now all of that ...... But i dont know where i put it i tried spawn() and when team score >= 2 then ... And ... And... The problem is where and why But thanks for the replys ;) When i use player.getall i get the spectator team too?
[QUOTE=poepel;49378461]I now all of that ...... But i dont know where i put it i tried spawn() and when team score >= 2 then ... And ... And... The problem is where and why But thanks for the replys ;) When i use player.getall i get the spectator team too?[/QUOTE] Yes when using player.getall() you get spectators too but you can sort thru the players by running a for loop [lua] for key, value in pairs(player.getall()) do -- Code end [/lua] and checking if entity is alive via player:Alive() then adding them to a alive table Useful websites to help you [url=http://wiki.garrysmod.com/page/Main_Page]The Wiki[/url] [url=http://www.youtube.com/]Youtube has some decent tuts[/url]
thanks
Sorry, you need to Log In to post a reply to this thread.