Text is not a valid member of Player? Strange error

Hey.

I was bored and decided to make a Login System, weird thing is: Password isn’t getting changed.

Server script:

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SEND_NEW_PASSWORD_DATA = ReplicatedStorage.LoginSystem.RemoteEvents:FindFirstChild("SEND_NEW_PASSWORD_DATA")

Players.PlayerAdded:Connect(function(Player)
	
	local LoginSystem = Instance.new("Folder", Player)
	LoginSystem.Name = "LoginSystem"
	
	local PasswordFolder = Instance.new("Folder", LoginSystem)
	PasswordFolder.Name = "PasswordFolder"
	
	local PlayerCheck = Instance.new("Folder", LoginSystem)
	PlayerCheck.Name = "PlayerCheck"
	
	local Password = Instance.new("StringValue", PasswordFolder)
	Password.Name = "Password"
	Password.Value = ""
	
	local newPlayer = Instance.new("BoolValue", PlayerCheck)
	newPlayer.Name = "newPlayer"
	newPlayer.Value = true
	
	
	SEND_NEW_PASSWORD_DATA.OnServerEvent:Connect(function(plr, data)
		
		local newPlayerData = plr.LoginSystem.PlayerCheck.newPlayer
		local passwordData = plr.LoginSystem.PasswordFolder.Password
		
		newPlayerData.Value = false
		passwordData.Value = data.Text --error line
		
		print(data)
		
	end)
	
end)

Client script:

local Players = game:GetService("Players")
local Player = Players.LocalPlayer

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvents = ReplicatedStorage.LoginSystem.RemoteEvents
local SEND_NEW_PASSWORD_DATA = RemoteEvents:FindFirstChild("SEND_NEW_PASSWORD_DATA")

local LoginUI = script.Parent
local LoginFrame = LoginUI.LoginFrame
local TitleLabel = LoginFrame.TitleLabel

local NewPlayerFrame = LoginFrame.NewPlayerFrame
local CreateLogin = NewPlayerFrame.CreateLogin
local NewPasswordInput = NewPlayerFrame.NewPasswordInput

local PasswordFrame = LoginFrame.PasswordFrame
local NameLabel = PasswordFrame.NameLabel
local PasswordInput = PasswordFrame.PasswordInput
local IncorrectPasswordLabel = PasswordFrame.IncorrectPasswordLabel
local Login = PasswordFrame.LoginButton

CreateLogin.MouseButton1Click:Connect(function()
	local data = NewPasswordInput.Text
	print(data)
	SEND_NEW_PASSWORD_DATA:FireServer(Player, data)
	NewPlayerFrame.Visible = false
	PasswordFrame.Visible = true
end)

I know why do not fire player in a remote evnt fireserver just do this:

event:FireServer(datathing)

what is the point of turning a string into a string?

That’s not the thing.

local data = NewPasswordInput.Text
SEND_NEW_PASSWORD_DATA:FireServer(data)

We’re firing a remoteevent to server with the NewPasswordInput text.

The server has to change this value on the Player.LoginSystem.PasswordFolder.Password. (StringValue)

It was my mistake do not fire the player in a remote event fireserver

No it automatically passes the player so it would be:

--localscript
event:FireServer(datathing)
--otherscript
event.OnServerEvent:Connect(function(player,data)

Fixed that,

New issue is that the value goes to nil for no reason lol

image
image

Change it to passwordData.Value = data

2 Likes

Let me record a video and show yoju.

1 Like

Well that is really rude :grinning_face_with_smiling_eyes:

Oh well that worked lol i’m so stupid

THanks @zaydoudou and @FrazedGreatness2

1 Like

Your welcome! Just remember to debug something for around 20 minutes just in case if its a dumb error

1 Like