Hi guys!
So I wrote this small script that basically adds a GUI ontop of someone's head when an admin chats a certain command. In this case that would be "wanted/(USERNAME)".
The script works perfectly fine, when typed, the user gets a GUI ontop of their head. My only problem is; the username MUST be typed with correct capitals. Example;
user = Player1
"wanted/Player1" <-- Works
"wanted/player1" <-- Does not work!
How can I make sure the script works even with lowercases, whilst still using the string.sub?
My function:
if string.sub(msg, 1,7) == "wanted/" and game.Players:FindFirstChild(string.sub(msg, 8)) then
local guiclone = gui:Clone()
guiclone.Parent = game.Players:FindFirstChild(string.sub(msg,8)).Character.Head
guiclone.Enabled = true
print(string.sub(msg, 8).." is wanted!")
end

1 comment
You'd have to create a separate function that retrieves the player.