Hi, i can’t figure out why this is not working. This is in a localscript.
local Frame = script.Parent.Frame
local Username = Frame.Username.Username
local Wachtwoord = Frame.Wachtwoord.Wachtwoord
local Inloggen = Frame.Inloggen
local Help = Frame.Help
local Groep = 5348676
local Rank = 9
Inloggen.MouseButton1Click:Connect(function(plr)
print(plr.Name) --only "plr" is also not working, in the output it says "nil"
end)
Why do you take the player out of the button? You should use local scripts in order to contact gui elements. Therefore, to find out the player’s name you need to:
local Frame = script.Parent.Frame
local Username = Frame.Username.Username
local Wachtwoord = Frame.Wachtwoord.Wachtwoord
local Inloggen = Frame.Inloggen
local Help = Frame.Help
local player = game:GetService("Players").LocalPlayer
local Groep = 5348676
local Rank = 9
Inloggen.MouseButton1Click:Connect(function()
print(player.Name)
end)