I'm trying to make night vision googles and when you equip a tool called "NightVision" a transparent green gui comes up. For some reason this script isn't working. What did I do wrong?
if game.StarterPack.NightVision.Equipped = true then
local gui = Instance.new("ScreenGui",game.StarterGui)
local frame = Instance.new("Frame",game.StarterGui.gui)
frame.Size = UDim2.new(0.999, 0,0.994, 0)
frame.BackgroundColor3 = UDim2.new(0, 212, 0)
frame.BackgroundTransparency = .6
end
if game.StarterPack.NightVision.Equipped = false then
game.gui:Remove()
end

1 comment
Just saying, the question below works, but for future references if statements require 2 '=='