The if statement in my code will not work for some reason when I include this boolean value even though the value is true.
local part = workspace:WaitForChild("ActivateBurgerJob")
local plr = game.Players.LocalPlayer;
local PlayerModule = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule"))
local Controls = PlayerModule:GetControls()
local ui = script.Parent;
canSeeGui = script.Parent.Parent:WaitForChild("canSeeGui")
local function onTouch(hit)
print(canSeeGui.Value)
if plr.Character ~= nil and hit.Parent == plr.Character and canSeeGui == true then
wait(0.2)
canSeeGui = false
Controls:Disable()
ui.Enabled = true
print("Contrls disbaled")
end
end

3 comments
lol for some reason it wont let me post an answer. The problem is you forgot to get the .Value property of the BoolValue; you are checking to see if the value exists, not if it is true. Change line six to "canSeeGui = script.Parent.Parent:WaitForChild("canSeeGui").Value"
Ok so this seems to fix if statement and allow it to work, although line 12 does not change the value in the folder, is this because it is a local script?
It should change the value for the player who's starterGUI this is in. For all other players, the game will act like the value is still true.