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

How will I automatically guess players name when entering the start of it?

Asked by 6 years ago

I am attempting to make a moderation GUI that allows my in-game admins to teleport players, kick them etc. However, right now they need to enter in the players full name (ROBLOX instead of ROB or something) I have tried to use :findfirstchild, however that returns nil unless the players name is completely entered.

1 answer

Log in to vote
0
Answered by 6 years ago
local SearchFor = "Lua"
for i,v in pairs(game.Players:GetPlayers()) do
if v.Name:lower():sub(1,SearchFor:len()) == SearchFor:lower() then
print(v.Name)
end
end
0
Thank you WoW_AWSOME 2 — 6y
Ad

Answer this question