Hi there,
I am attempting to make something where I can type a player’s name into a TextBox, and it would search to see if that particular player is in the game.
However, an error comes out of this whenever I try to search:
Line 5: attempt to call a userdata value
Here is the code: (This is inside of a localscript)
script.Parent.MouseButton1Click:Connect(function()
local name = script.Parent.Parent.enterName.Text
print("searching for player "..name)
if game.Players(name) == nil then
print("player not found!")
else
print("player "..name.." was found!")
end
end)
Any help would be appreciated!