TextBox.Text is not working

this code is not working, line 2 is script.Password(TextBox).Text i cant get the text

local player = game.Players.LocalPlayer
local pass = script.Parent.password.Text
local db = false
script.Parent.go.MouseButton1Click:Connect(function()
	if db == false then
		db = true
		game.ReplicatedStorage.RemoteEvents.Join:FireServer(pass)
		wait(1)
		db = false
	end
	
end)

i uploaded video for you understand problem

You are setting the pass variable when the script runs for the first time (the textbox is empty). Change line 7 to:

game.ReplicatedStorage.RemoteEvents.Join:FireServer(script.Parent.password.Text)
3 Likes

As he said, this should solve the issue. Here is the full script

--// Services
local Players = game:GetService("Players");
local ReplicatedStorage = game:GetService("ReplicatedStorage");

--// Variables
local Player = Players.LocalPlayer
local Password = script.Parent.password.Text
local db = false

script.Parent.go.MouseButton1Click:Connect(function()
	if db == false then
		db = true
		ReplicatedStorage.RemoteEvents.Join:FireServer(script.Parent.password.Text)
		wait(1)
		db = false
	end

end)
2 Likes

oh i missed it, i havent looked at the studio for a long time, thanks.

2 Likes

Consider setting his reply as the solution so you don’t get spammed with replies.

1 Like