How can I solve so that in line 16, there is not that yellow line?

Well, recently I wanted that when pressing a textButton, the value is moved to a Folder of a local player, but I don’t want the yellow line of line 16 to be seen, the script works, and I want to remove it to avoid future problems

local aceptar = script.Parent:WaitForChild("BAceptar")
local cancelar = script.Parent:WaitForChild("CCancelar")
local Value = script.Parent.Parent:WaitForChild("Abrir")
local Main = game.Players.LocalPlayer.Keys

script.Parent.Parent.Abrir:GetPropertyChangedSignal("Value"):Connect(function()
Value = script.Parent.Parent.Abrir.Value
end)

game.Players.PlayerAdded:Connect(function(player)
local remotevent = game.ReplicatedStorage:WaitForChild("RemoteEvent")
remotevent:FireClient(player)
end)

aceptar.MouseButton1Click:Connect(function()
MainValue = Main:WaitForChild("MenuKey")
MainValue.Value = Value
end)

(Sorry for the quality but that’s how you let me put this page)

Add a local before MainValue

local MainValue = Main:WaitForChild("MenuKey")

It’s probably a suggestion to make it local since it’s not in the global scope of the script and is only used in that event

1 Like

ah, it’s true, I don’t know why but I had tried it before and it hadn’t worked, for some reason now it does

I’m glad that that was the solution! If you have anymore issues don’t be afraid to make another post!!