I can't make a frame visible

Well the player variable is calling .Name, so remove it from the variable

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

Put the SurfaceGui in StarterGui.

Your LocalScript will now look like:

local Frame = script.Parent.Parent
local DownFrame = Frame:WaitForChild("DownloadFrame")
local Button = script.Parent
local TransferButton = Frame:WaitForChild("Transfer")


local TechComputer = workspace:WaitForChild("TechComputer") -- or your path to TechComputer, but always use :WaitForChild to make sure the model loads first or else it will return nil
local Occupied = TechComputer:WaitForChild("Ocupado")
local Nickname = TechComputer:WaitForChild("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)

Set the Adornee in the surfacegui’s property to your screen part:


This is how LocalScripts and SurfaceGui should work if it will use a button to click.

Thats not the case right now he converted his script to a server script

It wouldnt be a problem if theres alot of same computers? The objective of this “item” is as same as job post

If he converted to a Script, then he could use a ClickDetector. It can get the player instance easily.

Server scripts can still detect Gui button clicks so that wont be necessary

1 Like

Please read this post @OmqFroko it might be the cause of your problem.

It now causes the value being as Game

The nickname’s value you mean?

Exactly.
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

Well we’re not sure how the nickname’s value gets changed, can you show the code where it changes?

Its in a script from a model “checker”.

-- Checker

local click = script.Parent
local Paper = script.Parent.Parent.Parent.Paper
local BillGui = script.Parent.Parent.Parent.Up.BillboardGui
local Icon = BillGui.Icon

-- Computer

local Comp = script.Parent.Parent.Parent.Parent.Computer
local Gui = Comp.Screen.DownloadSystem
local Block = Gui.Main.Block

-- Value

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

-- TS --
local TS = game:GetService("TweenService")
local TweeningInfo = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)

local DownPaper = script.Parent.Parent.Parent.DownPaper
local DPX = DownPaper.CFrame.Position.X
local DPY = DownPaper.CFrame.Position.Y
local DPZ = DownPaper.CFrame.Position.Z
local PX = Paper.CFrame.Position.X
local PY = Paper.CFrame.Position.Y
local PZ = Paper.CFrame.Position.Z

local DownLoc = { Position = Vector3.new(DPX, DPY, DPZ)}
local UpLoc = { Position = Vector3.new(PX, PY, PZ)}
local PaperDown = TS:Create(Paper, TweeningInfo, DownLoc )
local PaperUp = TS:Create(Paper, TweeningInfo, UpLoc )

click.MouseClick:Connect(function(player)
	if player.TeamColor == BrickColor.new("Maroon") then
		if Ocupado.Value == false then
			Ocupado.Value = true
			local thumbType = Enum.ThumbnailType.HeadShot
			local thumbSize = Enum.ThumbnailSize.Size420x420
			local content, isReady = game.Players:GetUserThumbnailAsync(player.UserId, thumbType, thumbSize)
			Paper.Transparency = 0
			wait(0.1)
			PaperDown:Play()
			wait(0.5)
			Icon.Image = content
			wait(0.1)
			Block.Visible = false
			Nickname.Value = player.Name
		else
			if Ocupado.Value == true then
				print("PC já está ocupado")
			end
		end
	end
end)

When I saw that it takes 11 parents to get to the player, something’s not right. OP should use a click detector or put the SurfaceGui in StarterGui with Adornee to the screen part inside the computer model.

But again, it wouldnt make it a problem incase theres alot of Computers with same function?

This is in local script right?

No, its in a script.

As the local, it doesnt work

Does this change the Ocupado and Nickname or does it print “PC já está ocupado”

Thats from “checker”, the script of it works complety fine so yes.

The only problem it is from the ImageButton located at Computer

Put this in when clicked function. Switched this to a Local script and get local player

Again, the local script doesnt work at all.

LocalScript doesnt even show anything on output and while the script actually does it. But both of them doesnt work.