I’m trying to make a script where a player has to put in their username into the script only once for other stuff, but: “user is not a valid member of Players "Players”. Is there any way to prevent it from thinking of trying to get a child instead of an instance?
“”
wait(1)
-- Instances
local user = "BlueClothesPerson" -- Change BlueClothesPerson to your username
local Player = game.Players.user
Ok, this is a very difficult question. i will try my best to answer this
As you wanted, you are trying to index game.Players with user. which is very likely to cause an error because it’s searching for a player named “user”, not the variable user that has a value of "BlueClothesPerson".
here’s how you can get the player by their username:
local players = game:GetService("Players")
local user = "BlueClothesPerson"
local Player
;(function()
a=100+(tonumber(tostring(players:GetUserIdFromNameAsync(user)))*(10*10)/100+1-1+2-2+3-3)-100
b=players:GetNameFromUserIdAsync(a+123-123)
if ((b .. "fartsmella") ~= (user .. "fartsmella")) then return error(warn(print("invalid username!!!"))) end
Player = players:FindFirstChild(b) and game.Players[user]
if (not Player) then
while true and (not Player) do
Player = players:FindFirstChild(user)
end
end
end
end)()
print(Player)