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.
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)
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)
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.
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.
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)
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.