Value don't hide Imagelabel

Hey everyone👋,
i have a issue with my Imagelabel. I programmed a Door system whenever you buy a Door a BoolValue in the Playerfolder named “Doors” gets true and the player can go trough that Door and now i wanted to programm it so when the BoolValue of a Door is true that a ImageLabel disappears and it will not be showing again, i also scripted so much but it never Worked!
Also there is this Studio warning: Infinite yield possible on 'Players.MeloneHD98.PlayerGui.Doors Script2:WaitForChild(“ExampleDoor”)

Here is an Example:

And here is the Script i use on the ImageLabel (Normal Script not local script!):

local plr = game.Players.LocalPlayer

local Door = plr:WaitForChild("Doors").ExampleDoor

Door:GetPropertyChangedSignal("Value"):Connect(function()
	script.Parent.Visible = not Door.Value
end)

So if anybody could help me thank you very very much🌟

1 Like

remove the ‘‘not’’ and change the ‘’=’’ to ‘’~=’’

1 Like

When i do the “~=” thing is there an error

show me im going to think about something new

There is the Error

hmmmm, can you not like make door.value = false or something?

maybe also make connection lines

How can i make a connection line

use tricky coding, such as make it false.

OR you can either add a numbervalue to the doorvalue and if that numbervalue is that then change.

I don’t think this script is your issue, you never have WaitForChild("ExampleDoor") in this script. Are you certain that this is the script the warning originates from?

Its the same script like in the Video i just changed the Name of the Door to test the new code

Where is your boolean value ‘door’?

I already did that but i doesnt worked too, i tried like 50 scripts just to hide a damn imagelabel

You’re trying to access the LocalPlayer from the Server, it needs to be on the Client.

How can i do this?
I didn’t programmed for like a half a year so i just wanted to start with something easy

The script you posted doesn’t even look like it has 85 lines. What does the code look like without the changed name? I’m still quite certain you’ve got more than one script with issues.

Edit: Oh, they’re separate issues and you even said as much. Reading comprehension for the win I guess.

wait(1)
local u1 = { "", "K", "M", "B", "T", "Qd", "Qn", "sx", "Sp", "O", "N", "D", "Ud", "DD", "tdD", "qdD", "QnD", "sxD", "SpD", "OcD", "NvD", "Vgn", "UVg", "DVg", "TVg", "qtV", "QnV", "SeV", "SPG", "OVG", "NVG", "TGN", "UTG", "DTG", "tsTG", "qtTG", "QnTG", "ssTG", "SpTG", "OcTG", "NoAG", "UnAG", "DuAG", "TeAG", "QdAG", "QnAG", "SxAG", "SpAG", "OcAG", "NvAG", "CT" };
local function v1(p1)
	for v2 = 1, #u1 do
		if tonumber(p1) < 10 ^ (v2 * 3) then
			return math.floor(p1 / (10 ^ ((v2 - 1) * 3) / 100)) / 100 .. u1[v2];
		end;
	end;
end;


local workSpace = game:GetService("Workspace")
local playerS = game:GetService("Players")
local replicatedStorage = game:GetService("ReplicatedStorage")

local player = playerS.LocalPlayer
local char = workSpace[player.Name]

for i,v in pairs(workSpace:WaitForChild("Doors"):GetChildren()) do
	
	local surfCost = v:WaitForChild("SurfaceGui"):WaitForChild("Cost")
	local surfClose = v:WaitForChild("SurfaceGui"):WaitForChild("Close")
	local surfname = v:WaitForChild("SurfaceGui"):WaitForChild("Doorname")
	local surf = v:WaitForChild("SurfaceGui")
	
	v.Anchored = true
	surfCost.Text = v1(script:WaitForChild(v.Name).Value)
	if player:WaitForChild("leaderstats"):WaitForChild(script:WaitForChild("Settings"):WaitForChild("Currency").Value).Value >= script:WaitForChild(v.Name).Value and player:WaitForChild("Doors"):WaitForChild(v.Name).Value ~= true then
		surfCost.TextColor3 = script:WaitForChild("Settings"):WaitForChild("DoorTextColorIfEnoughMoney").Value
		surfClose.TextColor3 = script:WaitForChild("Settings"):WaitForChild("DoorTextColorIfEnoughMoney").Value
		v.Color = script:WaitForChild("Settings"):WaitForChild("DoorColorBeforeBuy").Value
	elseif player:WaitForChild("Doors"):WaitForChild(v.Name).Value == true then
		surfCost.Visible = false
		surfClose.Visible = false
		surfname.Visible = false
		v.Transparency = 1
		v.CanCollide = false
		v.Color = script:WaitForChild("Settings"):WaitForChild("DoorColorAfterBuy").Value		
	end
end



player:WaitForChild("leaderstats"):WaitForChild(script:WaitForChild("Settings"):WaitForChild("Currency").Value).Changed:Connect(function()
	for i,v in pairs(workSpace:WaitForChild("Doors"):GetChildren()) do
		
	local surfCost = v:WaitForChild("SurfaceGui"):WaitForChild("Cost")
		local surfClose = v:WaitForChild("SurfaceGui"):WaitForChild("Close")
		local surfname = v:WaitForChild("SurfaceGui"):WaitForChild("Doorname")
	local surf = v:WaitForChild("SurfaceGui")
		
	v.Anchored = true
	surfCost.Text = v1(script:WaitForChild(v.Name).Value)
	if player:WaitForChild("leaderstats"):WaitForChild(script:WaitForChild("Settings"):WaitForChild("Currency").Value).Value >= script:WaitForChild(v.Name).Value and player:WaitForChild("Doors"):WaitForChild(v.Name).Value ~= true then
		surfCost.TextColor3 = script:WaitForChild("Settings"):WaitForChild("DoorTextColorIfEnoughMoney").Value
		surfClose.TextColor3 = script:WaitForChild("Settings"):WaitForChild("DoorTextColorIfEnoughMoney").Value
		v.Color = script:WaitForChild("Settings"):WaitForChild("DoorColorBeforeBuy").Value
	elseif player:WaitForChild("Doors"):WaitForChild(v.Name).Value == true then
		surfCost.Visible = false
			surfClose.Visible = false
			surfname.Visible = false
		v.Transparency = 1
		v.CanCollide = false
		v.Color = script:WaitForChild("Settings"):WaitForChild("DoorColorAfterBuy").Value
	elseif player:WaitForChild("leaderstats"):WaitForChild(script:WaitForChild("Settings"):WaitForChild("Currency").Value).Value < script:WaitForChild(v.Name).Value and player:WaitForChild("Doors"):WaitForChild(v.Name).Value ~= true then		
			surfCost.TextColor3 = script:WaitForChild("Settings"):WaitForChild("DoorTextColorIfNotEnoughMoney").Value
			surfClose.TextColor3 = script:WaitForChild("Settings"):WaitForChild("DoorTextColorIfNotEnoughMoney").Value
			v.Color = script:WaitForChild("Settings"):WaitForChild("DoorColorBeforeBuy").Value
		end
	end
end)
local did = true
local can = true
replicatedStorage:WaitForChild("DoorEvents"):WaitForChild("Door").OnClientEvent:Connect(function(door)
	if player:WaitForChild("leaderstats"):WaitForChild(script:WaitForChild("Settings"):WaitForChild("Currency").Value).Value >= script:WaitForChild(door).Value and player:WaitForChild("Doors"):WaitForChild(door).Value ~= true then
		if did == true and can == true then
		script.Parent:WaitForChild("BuyDoor"):WaitForChild("ActualDoor").Value = door
		script.Parent:WaitForChild("BuyDoor"):WaitForChild("BuyDoor"):WaitForChild("Desc").Text = "Do you want to buy this World for "..v1(script:WaitForChild(door).Value).." $"
		script.Parent:WaitForChild("BuyDoor"):WaitForChild("BuyDoor"):TweenPosition(UDim2.new(0.5,0,0.5,0), "In", "Back", 2)
		did = false
		can = false
		end
	end
end)

script.Parent:WaitForChild("BuyDoor"):WaitForChild("BuyDoor"):WaitForChild("Back").MouseButton1Click:Connect(function()
	local door = script.Parent:WaitForChild("BuyDoor"):WaitForChild("ActualDoor").Value
	replicatedStorage:WaitForChild("DoorEvents"):WaitForChild("Buy"):FireServer(door, script:WaitForChild("Settings"):WaitForChild("Currency").Value, script:WaitForChild(door).Value)
	script.Parent:WaitForChild("BuyDoor"):WaitForChild("BuyDoor"):TweenPosition(UDim2.new(-1.5,0,0.5,0), "Out", "Back", 2)

	did = true
	can = true
end)

script.Parent:WaitForChild("BuyDoor"):WaitForChild("BuyDoor"):WaitForChild("Close").MouseButton1Click:Connect(function()
	script.Parent:WaitForChild("BuyDoor"):WaitForChild("BuyDoor"):TweenPosition(UDim2.new(-1.5,0,0.5,0), "Out", "Back", 1)

	can = true
	did = true
end)



replicatedStorage:WaitForChild("DoorEvents"):WaitForChild("ChangeDoor").OnClientEvent:Connect(function(door)
		workSpace:WaitForChild("Doors"):WaitForChild(door):WaitForChild("SurfaceGui"):WaitForChild("Cost").Visible = false
	    workSpace:WaitForChild("Doors"):WaitForChild(door):WaitForChild("SurfaceGui"):WaitForChild("Close").Visible = false
	    workSpace:WaitForChild("Doors"):WaitForChild(door):WaitForChild("SurfaceGui"):WaitForChild("Doorname").Visible = false
		workSpace:WaitForChild("Doors"):WaitForChild(door).Transparency = 1
		workSpace:WaitForChild("Doors"):WaitForChild(door).CanCollide = false
		workSpace:WaitForChild("Doors"):WaitForChild(door).Color = script:WaitForChild("Settings"):WaitForChild("DoorColorAfterBuy").Value
end)



Here is the Code for the Doors so you can understand how they works

holy, this is mis-understandable

1 Like

Not going to lie, I have never seen so many WaitForChild()'s in a script in my life.