Mello Trainer command buffer timer

Hello everyone. I am currently working on the development of a server and have run into this issue I can’t seem to overcome. I currently have a server running and effectively am trying to limit the options of Mello Trainer. So far I have been able to do everything I have needed to, but my limited knowledge of LUA has really made me struggle with this issue.

More specifically, Mello Trainer includes a vehicle spawner, the snippet I am trying to modify specifically is here and I am attempting to only allow spawning once every X seconds. Through my attempts I have tried primarily using os.time() (which seems to never work) or a variety of Wait(x) timers in conjunction with boolean values but to no avail. I am familiar with the logic that needs to be used, just not familiar with LUA specifically.

The entire Mello Trainer can be found here if you need more context.

If someone could help me I would greatly appreciate it and thank you in advance!

Try this, I didn’t test it, but it should work.

Download removed - wasn’t working

Cooldown Duration: 10 Seconds, can be edited in the cl_variables.lua

As-is, when running your code it doesn’t complete the first spawn saying “Cooldown, 0sec to spawn” and subsequent spawns resulted in an increased time on the cooldown warning. Currently trying to work through the logic myself, what exactly does GetGameTimer() return?

lol, my bad, I didn’t finished the thinking about it before I wrote it. That is what tiredness does :grin:

Try again with this one:

Download removed - wasn’t working

Still no luck, now just allows normal spawning with no cooldown ever

Weird, I will check what I actually did there when I am at home ^^

So, Fixed and tested. I can confirm now, that it works.

cl_variables.lua (8.8 KB)
cl_vehicles.lua (34.4 KB)

1 Like

Thank you for all of your help, I really appreciate it! One really quick last question if you happen to know, I have Essentialmode on my server, how would I go about effectively pulling if someone’s permission level was say, 5.

I can see on their website they have the “user.getPermissions()” getter, but how do I create “user” in that example

Sorry I am not familiar with ESMode. You will get better support, when you ask in the ESMode Topic

1 Like