So I have a a LocalScript that actives a RemoteFunctions. That RemoteFunction sets a BoolValue within the LocalPlayer to true, on the Server and Client.
These scripts are working perfectly fine ^
I have another script where if you click F on your keyboard it will check if
if debounce == false and BoolValue == true then
But even if that BoolValue == true then script thinks its false and it says
"You need to Unlock the move"
local Player = game:GetService("Players").LocalPlayer
local UIS = game:GetService("UserInputService")
local Sounds = game:GetService("ServerScriptService")
local Unlock = Player.Unlocks:WaitForChild("Magic: Raitoningu")
local Unlocked = Unlock.Value
local debounce = false
local cooldown = 8
local rp = game:GetService("ReplicatedStorage")
local RE = rp["Magic: Raitoningu"]
function cameraShake()
local Character = Player.Character
local length = 10
for i = 1, length do
Character.Humanoid.CameraOffset = Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1))
wait()
end
Character.Humanoid.CameraOffset = Vector3.new(0,0,0)
end
wait(1)
UIS.InputBegan:Connect(function(input,isTyping)
if isTyping then
return
elseif input.KeyCode == Enum.KeyCode.F then
if Unlocked == false then
print("You need to Unlock the move")
end
if debounce == true then
print("Youre on Cooldown")
end
if debounce == false and Unlocked == true then
debounce = true
RE:FireServer()
spawn(function()
wait(.75)
cameraShake()
end)
end
end
end)
RE.OnClientEvent:Connect(function()
wait(cooldown)
debounce = false
print("Magic: Raitoningu Ready")
end)
Sorry if this post sucks, I havent posted in a while...

5 comments
I suppose your BoolValue is your variable Unlocked?
This problem is actually rather simple. Your variable Unlocked saves the Value at that time, when the script creates the variable, if Unlock.Value changes after that, the value of the variable will still be the same
So i should make the local Unlocked = Unlock.Value inside the If statement
Thankyou So much, Ive been stuck on this for so long..
I mean your variable Unlocked is not needed. in your if statement, write if Unlock.Value then