How to make a ban hammer

Just make it so when you hit someone with the hammer a text gui where you put the reason in. You can save the reason in a string value and do
hitPlayer:Kick("You’ve been banned”…plr.reason.Value)
Something like that

because, you’re basically telling the script to display the kick message when you ban the player, so whatever you change the kick message to will display to all the players that are banned from the game

i recommend doing what @TyePHX said…

Okay, but you should probably tell the OP that. Not me.

@Valkyrop Feel free to make your own add-ons, such as a custom reason! The script is open-source.

2 Likes

can i edit the script? i’ve made a system like this before

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()