Help with rename chat command

can u send a screenshot of the whole script pls?

is a sintaxis error:

image

i wll try to fix the code, brb

1 Like

Thanks you a lot brother :frowning:

in the last CharacterAdded "end " have an “)”

1 Like

Oh this works without errors! but the player name does not change :frowning:

oh, i dont know how to fix that i’m sorry :confused:

1 Like

It’s okay, no problem, thank you very much! :smiley: thank you very much for all your effort :smiley:

1 Like

In the past I normally have changed the model name of the character. The model name of a player’s character in the past is usually what results in the username above their head.

I haven’t been keeping up much with DisplayNames, but last I heard I thought they had gotten disabled, at least, temporarily.

Oh I think I know what the problem is. You wrote in the that if the player types .rename then the name and then the new name needed, it will work. This should’ve worked, but look, you wrote '.rename '…Player2.Name…msg2. This is with NO spaces. Roblox cannot tell if it starts a new word or not. To fix this just at a …" " in the middle. This is how the new script should look like:

if message == '.rename ' .. Player2.Name.."".. msg2 then

Oh i see :cold_sweat: How could I change that msg2 for the text that the player writes? :scream:

Oh yes I understand the problem, give me a bit of time ill get back to you

1 Like

Thanks you a lot brother! :smiley:

Ok I have 2 solutions for you. First one, you make it so that the player chats twice to make it work. So the first time they type .rename Someone. and then on a second line they type what they want to rename the person too. The second solution is much much worse as you make a list of pre-defined names and these names are the only names that the player can rename the other player to. Tell me which solution you prefer and ill tell you the code for it.

what do you mena with chats twice to make it work? :scream:

I meant that they will first chat “.rename Someone”
and type enter, and then they will type the new name.
Example:
.rename AAD232007
Somebody

This should change my name to Somebody

Oh I understand, but there is no way to make this only be written once .rename someone newNameHere :scream:

I can’t think of any solution I’m sorry. If I find one I will tell you.
Edit: I have an idea, but this will stroll away from the chat commands entirely. My idea is to use a GUI to make this work.

The DisplayName property on the humanoid has NOTHING to do with the new update coming out soon. DisplayName on the humanoid is just what it shows above a player’s head. Renaming the model will throw an error by the way.

1 Like

Alright, so I’ve seen your previous post and assume you’re creating an admin system. I was going to respond to this post with the code that you provided, albeit edited on my part. However, I noticed that you seem to be coding your admin system so its rigid and specific. While this isn’t necessarily a bad thing in coding it isn’t what you want to do for an admin system. For an admin system you want to make it so it has a strict structure and dataflow for processing the events and then a modular design for the commands that allows you to easily create new ones. You want to have a system in place to handle the things listed below:

  • A listener for whenever a player chats.
  • Some sort of parser to process, convert, and filter the data received whenever the player does speak.
  • A command module that makes is easy to expand and add new commands (If you ever want to add new commands that is.)
  • (optional) A rank system for level of access to commands.
  • (optional) Some sort of logger to store event data for the game session.

Of course you don’t have to have all of this. When you are developing something on your own it’s what you want to do that matters. These are just tips to help make it easier to develop one. I’ve taken your base code and transformed it into an Admin System to help you get started. You can get it here.

P.S. - If you want me to make it so it Saves your data about who is admin and/or for what names people have then just tell me and I’ll update the module and tell you in this topic when it’s been updated.

4 Likes