Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I am trying to shorten usernames, one answer I got is string.find, how would I use string.find()?

Asked by 4 years ago

So I am just trying to figure out how to use it to shorten usernames (I believe it can do that) in like admin commands for example. Any answers?

0
I recommend using string.sub. raid6n 2196 — 4y
0
So, how would I use that? I am a trash scripter sorry. lol DemonicxVibes -5 — 4y
0
when i was doing this i followed an example on the developer forums https://devforum.roblox.com/t/how-to-make-a-player-name-shortening-system/609898/4 misha123 83 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

you can use

if string.sub(message:lower(),1,5) == "/kill" then
  local PlayerSelect = string.sub(message:lower(),7)

for i, v in pairs(game.Players:GetPlayers()) do
if v.Name == PlayerSelect then
v.Character.Humanoid.Health = 0
end
end
end

like that

0
well idk,it may,i dont remember yuni_Boy1234 320 — 4y
0
You can ask me if you want more lines yuni_Boy1234 320 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

These two articles will be able to help! they're a bit trickey but if you spend a minute to understand them it's not that bad! :)

Formatting and converting strings

String patterns

Answer this question