It's a simple GUI that im using to search for players. If a player's name is correct it will continue with the script. If it's not it will fail. I've been thinking o how to compare the names in the game.Players to my textbox.text. Anyone know how I could do this. Here is my code.
--This script runs the player editor execution.
--Made by Proo34
--Get Service Vaiables
local Players = game:GetService("Players")
--Variables
local playerfind = script.Parent.Main:WaitForChild("Search")
local playerName =script.Parent.Main:WaitForChild("SearchBar")
--Set
findplayer = 0
GUIRank = 0
--Main Player Graber
script.Parent.Main.Search.MouseButton1Click:Connect(function()
if script.Parent.Main.SearchBar.Text == "" then
print("No Player Searched")
findplayer = 1
else
print("Looking for Player with name ".. script.Parent.Main.SearchBar.Text)
local playerEditSearch = script.Parent.Main.SearchBar.Text
findplayer = 2
end
if findplayer == 2 then
if script.Parent.Main.SearchBar.Text == game.Players.LocalPlayer.name then
GUIRank = 1
print("Local player displayed")
script.Parent.GUIChanger.Value = 1
else
--here is where the search needs to look for players who aren't local player
--should be able to access all players
end
else
print("Canceling Search")
script.Parent.GUIChanger.Value = 0
end
end)

1 comment
Thank you so much! This really helps me!