a few questions.

i want to make an addon that has a bunch of diseases in it, not viruses. dont ban peas. all amazing jokes aside, i want it to be like the TVirus from Garry Bombs 5, you break it and if you go near it you get infected. so my questions:

○How can you tell who is within a certain radius of the prop when it is broken?

○How can i make a breakable prop, such as when this much damage has been taken, break.

○How can i then run, lets say this will make you say random things over the span of a minute. i cant get timers to work, even copy and pasting the code from the wiki does nothing.

Thank you!

https://wiki.garrysmod.com/page/ents/FindInSphere & https://wiki.garrysmod.com/page/Entity/IsPlayer
http://wiki.garrysmod.com/page/ENTITY/OnTakeDamage

For your third problem, can you post what code you tried?

the code from the wiki, first and second one. neither work. nothing is printed. http://wiki.garrysmod.com/page/timer/Create

Where did you put the code?

…lua file…
ran it client and server side
i did it in single player, is that the problem

Probably, noone really uses singleplayer for coding, since you’re then both, server and client, whats the exact path to the Lua file? Try downloading the Gmod Dedicated Server and run it there (free, obviously)

yeah my main PCs board just fried, i had srcds on there. would a p2p server happen to work?

[editline]1st October 2016[/editline]

doesnt make sense why if i run it on client it doesnt work

because since you’re no ‘real’ client, you’re mainly counting as server, since YOU host it.

that and this tutorial doesnt work.

there is no orange box folder, and when i paste the second command, it says its updating or something in another command prompt and closes. sooo…

and this is the tutorial i used to get srcds on my old computer

That tutorial is for the old HLDS Update Tool, use this: https://developer.valvesoftware.com/wiki/SteamCMD

[editline]1st October 2016[/editline]

Also, you can always do testing on a listen server, which doesn’t require dedi software.

thank you, crowbar wielding man on the internet

[editline]1st October 2016[/editline]

but thats for steamcmd, i forgot what commands i put in. something like verify -app 400 and then install -app 4100 or something

The commands and app list is on the page (4020 for GMod).

…gmod is 4000…
about 1/3 of the way though the update of whatever app is 4020

steamcmd.exe +login anonymous +force_install_dir d:/gmodserver/ +app_update 4020 validate +quit

gmod is 4000, the server software is 4020.

for some reason the srcds doesnt show up in the multiplayer menu, my friend mentioned that with srcds you cant get it in the multiplayer menu, but ive done it before.

[editline]1st October 2016[/editline]

ok it wasnt, still wont print. heres the code ffs.


local function PrintSomething( text )
    print( text )
end

local function PrintNoArguments()
    print( "fun with timers!" )
end

local function CreateSomeTimers()
    timer.Create( "UniqueName1", 1, 1, function() print( "inside" ) end )
    timer.Create( "UniqueName2", 2, 0, function() PrintSomething( "outside" ) end )
    timer.Create( "UniqueName3", 5, 1, PrintNoArguments )
end
hook.Add( "Initialize", "Timer Example", CreateSomeTimers )

timer.Start( "UniqueName1" )
timer.Start( "UniqueName2" )
timer.Start( "UniqueName3" )

and this is where i lay. crying, knowing the problem will never be fixed.

Where is this code ran? generally speaking i’ve done prints client side in single player and they always work for me. Has to either be your hook or where you placed the .lua file.

The server wont show because your ports are locked, simple, and again, give us the full file path, like /addons/lua/autorun/?

Put just a plan print at the top of the file to make sure it’s loading. Also, you have no reason to call timer.Start, it’s only to start paused timers.

i copied and pasted the code from the wiki for timer.create. just that

[editline]2nd October 2016[/editline]

its opened manually, via lua_openscript