I need to make the script detect if the text matches at least someone’s player name. If it is possible to do this without loops. I guess it’s done through “string.match()” but I don’t understand how to use it. Here is my script:
local players = game.Players:GetChildren()
script.Parent.Parent.CheckButton.MouseButton1Click:Connect(function()
if script.Parent.Text ~= players then -- there is check line
print("This player doesn't exist")
else
print("yaaaaa")
end
end)
script.Parent.Parent.CheckButton.MouseButton1Click:Connect(function()
for i,plr in ipairs(game.Players:GetPlayers()) do
if script.Parent.Text ~= plr.Name then
print("Text isnt equalt to player Name of : "..plr.Name)
end
end
end)
script.Parent.Parent:WaitForChild("CheckButton").MouseButton1Down:Connect(function()
for i, player in pairs(game.Players:GetChildren()) do
if player:IsA("Player") then
if script.Parent.Text ~= player.Name then
print("sus")
else
print("amogus")
end
end
end
end)
local Players = game:GetService("Players")
script.Parent.Parent.CheckButton.MouseButton1Click:Connect(function()
if Players:FindFirstChild(script.Parent.Text) then
print("Player is on server")
end
end)