Hello ive been having trouble with BoolValue.Changed
LocalScript code:
local clicksneeded = 10
local clickcooldown = 0.25
local clickcool = true
local clickedtimes = 0
local intime = script.Time.Value
local beingclicked = false
local clicked = false
local player = game.Players.LocalPlayer
player.PlayerGui.ScreenGui.TextButton.LocalScript.Completing.Changed:Connect(function()
print("Changed")
if script.Completing.Value == true then
player.PlayerGui.ScreenGui.TextButton.Visible = true
player.PlayerGui.ScreenGui.Countdown.Visible = true
end
if script.Completing.Value == false then
player.PlayerGui.ScreenGui.TextButton.Visible = false
player.PlayerGui.ScreenGui.Countdown.Visible = false
end
end)
script.Parent.MouseButton1Click:Connect(function()
if clickcool == true then
script.Parent.Parent.Countdown.Visible = true
clicked = true
beingclicked = true
print(beingclicked)
clickedtimes = clickedtimes + 1
script.Parent.Text = clickedtimes.. "/".. clicksneeded
clickcool = false
wait(clickcooldown)
clickcool = true
if clicksneeded == clickedtimes then
script.Completed = true
clickcool = false
script.Parent.Text = "Lockpicked sucsesfully!"
clicked = false
script.Completed = true
wait(1)
clickcool = true
script.Parent.Visible = false
print("done")
beingclicked = false
end
end
end)
ProxPrompt code:
local opened = false
local proximityPrompt = script.Parent
local isEquipped = game.StarterPack.Key.Script.isEquipped.Value
local leftDoor = script.Parent.Parent.Parent.Parent.LeftDoor.LeftDoor1
local rightDoor = script.Parent.Parent.Parent.Parent.RightDoor.RightDoor1
local completing = game.StarterGui.ScreenGui.TextButton.LocalScript.Completing.Value
proximityPrompt.Triggered:Connect(function()
if opened == true then
completing = false
print(completing)
print("Closed")
opened = false
else
completing = true
print(completing)
print("opened")
opened = true
end
end)
i hope you can help so heres more info,
The BoolValue is getting changed like shown in print(completing)
But it wont print that its been changed.