How to make a ban hammer

Of course! Its open for taking. I just made it quickly, so it is simplistic, but if you’d like to add on to it, go for it! @The_Finished

Yeah, that’s what I meant

Make a gui with a remote to be fired, etc…

If you do not mind my asking, what is the difference between task.wait() and wait()?

Its similar to RunService.HeartBeat()

task.wait() updates 2x faster than wait(), therefore more accurate

Another forum post: Difference between wait() and task.wait()? @Beloathed

1 Like

It isn’t similar to RunService.Heartbeat:Wait(), it is exactly identical when used without a provided time constraint. You will wait out the task scheduler’s current iteration, and resume after the next game simulation (Heartbeat is the final consistent step of the task scheduler- it happens after physics simulation, after garbage collection, after rendering at large).

The difference comes into play when you provide an ideal wait time. The functionality doesn’t really change if you understand how cyclical Roblox is, but this is the actual difference if you don’t know how task scheduling works:

  • The thread will still be suspended based around Heartbeat, that is in nature how this function works.
  • The task scheduler will run regardless. Your thread will be resumed when the given time is recognized as elapsed (which will be more accurate in comparison to wait) and the next heartbeat is reached.

You should not use wait anymore, it is on strong track for deprecation.

Well it is identical in functionality, but not service. Its a built in function, from what I understand.

There’s no need to use RunService.Heartbeat() in your case, task.wait() is great for here.

The task library works hand in hand with the task scheduler- you should take advantage of that everywhere that you can.

Yes I know, that’s why I didn’t use it.

You don’t need to do that. The code sample I gave will run only if the value exists, and if the value is true.

if not nil then
  print("this will print, as nil is converted to false and then negated to equal true")
end

if banSave:GetAsync(player.UserId) then
  print("this will print if the value exists and is true")
  -- nil: won't print
  -- false: won't print
  -- true: will print
end

Alright, alright, thank you all for the responses, however the first one was sufficient enough. I didn’t really need more than three replies.

task.wait() is newer and more accurate since it’s the same as RunService.Heartbeat:Wait()

Yes, I don’t need to, but I want to. If you’d like to copy the code and change it to that, feel free.

Nicee. But what are we gonna do if the guy were trying to ban starts running away, am I supposed to chase after him?

Its just for fun. If you’d like to use admin to fly or just make a UI instead, go for it!

Thanks for the tutorial! This will be useful to ban exploiters if you are too lazy to type in a ban command.

And its more fun! Chase the exploiters to their ban :joy:

You should use memory store for temp bans as they automatically expire.