Why Wont My Script Work?

So basically the problem im having is that my serverscript wont detect/use the text inside the text box…
heres the script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("Login")
local password = script.Parent.Parent.box.password
local main = script.Parent.Parent.Parent.Background
local login = script.Parent.Parent
local player = script.Parent.Parent.Parent.Parent.Parent

script.Parent.MouseButton1Click:Connect(function() 
	print("Clicked")
	if password.Text == "Test1" or
		password.Text == "Test2" then
		print(player.name .."Has Entered The Password Correctly!")
		remoteEvent:FireServer(player)
		login.Visible = false
		main.Visible = true 
	end

end)

Are there any errors presented?

im currently rechecking the script rn cuz i made some changes but at the time i made that post there were no errors

The code that you have given is in a local script right?

@everyone thanks for noticing the post! i accidentally made the mistake of using remote’s in a server script… hence why t wasnt working… once again thanks for taking a look at the post!!!

Just for quick clarification:

You can use these on the client side (Or a LocalScript):

  • FireServer()
  • OnClientEvent

You can use these on the server side (Or a Server Script, both of these require a Player argument in the first parameter):

  • FireClient()
  • OnServerEvent()
1 Like