print("username located")
print(username)
local players = game.Players
function kick()
print("Running function")
local username = script.Parent.Parent.Userkicker.Text
print("username located")
print(username)
print("kicking")
players.username:kick()
print("player kicked")
end
script.Parent.MouseButton1Click:connect(kick)
players.username:kick()
gives an error stating: 14:18:43.100 - username is not a valid member of Players
I dont know how to make the variable work in a middle of a path.

1 comment
Error:script:2:Unknown global "username".