If statement doesn't work on :FindFirstChild

I am struggling with this script, i want to achive it Enabling, when copied into Player’s GUI.

The problem is when i want to put this into if statement it marks it as a error.

image

script.Parent.ProximityPrompt.Triggered:Connect(function(Player)
	local rs = game.ReplicatedStorage.blackmarket.bm:Clone()
	
	rs.Parent = Player.PlayerGui	
	
	local a = Player.PlayerGui:FindFirstChild("bm")
	if a.Enabled == false then
		a.Enabled == true
	
	end
end)
1 Like

Remove one equal sign from the 2 equals.

== is used to check things

1 Like

Thats because you are using a Logical Expression instead of assiging the value to the Property, in short: change == to =

== is a Logical expression, used check if something is exactly equal to something, in which it can return true, or false

= Assigns a Value to something, such as a Variable, or a property

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.