I can't make a frame visible

I am having problems with a Surface Gui where I could not make a frame visible. I checked everything again and didn’t see where the error was, it didn’t show anything in the output either.

image

Scripts

Local Script in a ImageButton

local Button = script.Parent
local TransferButton = script.Parent.Parent.Transfer
local Frame = script.Parent.Parent
local DownFrame = script.Parent.Parent.DownloadFrame

local Occupied = script.Parent.Parent.Parent.Parent.Parent.Parent.Ocupado
local Nickname = script.Parent.Parent.Parent.Parent.Parent.Parent.Nickname

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

Button.MouseButton1Click:Connect(function()
	if Occupied.Value == true then
		if Player.Name == Nickname.Value then
			print(Player.Name)
			Button.Active = false
			TransferButton.Active = false
			DownFrame.Visible = true
		end
	end
end)
1 Like

Let’s work through this. First lets cleanup those variables:

local Button = script.Parent
local Frame =Button.Parent
local TransferButton = Frame.Transfer
local DownFrame = Frame.DownloadFrame

local Occupied = Frame.Parent.Parent.Parent.Parent.Ocupado
local Nickname = Frame.Parent.Parent.Parent.Parent.Nickname

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

Button.MouseButton1Click:Connect(function()
    print(Occupied.Value)
	if Occupied.Value == true then
         print("Plr Name:", Player.Name, "Nickname:", Nickname.Value)
		if Player.Name == Nickname.Value then
			print(Player.Name)
			Button.Active = false
			TransferButton.Active = false
			DownFrame.Visible = true
		end
	end
end)

Send a screenshot of the output after

Change the surface gui Face property.

Didnt appear nothing on output

Changing, only makes it dissapear

Is the Billboard GUI enabled, is the frame not transparent, Is this a billboard GUI, is Occupied value true and is player’s name same as nickname? You need to print all of these out. Try changing The LocalScript to a Server script.

I think, it looks like it’s in Workspace, LocalScripts don’t work in it.

Bill is enabled, frame is not visible in start but he will be if someone presses the button, occupied is true and player name is same.

Gonna try with the server script

The localscript its in the imagebutton as the image shows.

It didnt worked as the local didnt.

local Button = script.Parent
local TransferButton = script.Parent.Parent.Transfer
local Frame = script.Parent.Parent
local DownFrame = script.Parent.Parent.DownloadFrame

local Occupied = script.Parent.Parent.Parent.Parent.Parent.Parent.Ocupado
local Nickname = script.Parent.Parent.Parent.Parent.Parent.Parent.Nickname

Button.MouseButton1Click:Connect(function(player)
	if Occupied.Value == true then
		if player.Name == Nickname.Value then
			print(player.Name)
			Button.Active = false
			TransferButton.Active = false
			DownFrame.Visible = true
		end
	end
end)

Removed the LocalPlayer as the LocalPlayer doesnt work on script.

What if you remove all the ifs statement and just put the frame.visble there only.

I need these ifs statement.

So only the person who “owns” the computer can use it and not everyone

I know, im just saying to do it just incase its not the if statements

Ended up being the ifs statement the problem.

Try this instead:

local Button = script.Parent
local Frame =Button.Parent
local TransferButton = Frame.Transfer
local DownFrame = Frame.DownloadFrame

local Occupied = Frame.Parent.Parent.Parent.Parent.Ocupado
local Nickname = Frame.Parent.Parent.Parent.Parent.Nickname

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

Button.MouseButton1Click:Connect(function()
    print(Occupied.Value)
	if Occupied.Value == true then
         print("Plr Name:", Player.Name, "Nickname:", Nickname.Value)
		if Player.Name == Nickname.Value then
			print(Player.Name)
			Button.Active = false
			TransferButton.Active = false
			DownFrame.Visible = true
                  else
                      print("Not showing2")
		end
             else 
                     print("not showing1")
	end
end)

Nope, didnt worked, maybe trying on a script will be a better way.

local Button = script.Parent
local Frame =Button.Parent
local TransferButton = Frame.Transfer
local DownFrame = Frame.DownloadFrame

local Occupied = Frame.Parent.Parent.Parent.Parent.Ocupado
local Nickname = Frame.Parent.Parent.Parent.Parent.Nickname

local Player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name

Button.MouseButton1Click:Connect(function()
	print(Occupied.Value)
	if Occupied.Value == true then
		print("Plr Name:", Player.Name, "Nickname:", Nickname.Value)
		if Player.Name == Nickname.Value then
			print(Player.Name)
			Button.Active = false
			TransferButton.Active = false
			DownFrame.Visible = true
		else
			print("Not showing2")
		end
	else 
		print("not showing1")
	end
end)

Did make this with a script version and now the output showed but with a error.
image

Well instead of printing not showing2 print the Player.Name and the NickName.Value

Actually the Player Variable is already calling .Name, so either remove .Name from the if statement or remove it from the variable

The player.name shows nil and Nickname.Value shows my nick

1 Like