Restart Resource in .lua?

Instead of restarting a resource through something like icecon, is there a script to restart a resource that one could put in a .lua?

Nope, it’s programmatically impossible to do as resources are server-global.

Nooooooooooooooooooo! lol
Thanks @DGKN

1 Like

I know this thread is about 4 years old, but this may help someone…

ExecuteCommand(ā€˜ensure resource_name’)

lol people is so stupid, is normal than you can use ExecuteCommand(ā€˜restart start ensure stop etc …
resource_name’)

impossible does not exist in computer science, especially in programming, everything is possible, it depends on how much a programmer has a high IQ haha

I am using this to restart a script but the server always crashes and I get this error, does anyone have a solution for this? I have tested it on several machines, builds, and different servers. It always results in this crash.

CFG: add_principal resource.striata_resources group.admin
Script Server side: ExecuteCommand(ā€œensure striata_resourcesā€)