This is a snippet of a script I know works perfectly fine, because it does print (ended). However, working is not printed despite the fact there are no errors. The value is changed in the server side, and is not being detected by the local side, the script is being placed inside the players backpack
script.Switch.Changed:Connect(function()
print("Working")
if script.Switch.Value == false then
pcall(function()
for i, v in pairs(attacks:GetChildren()) do
CAS:UnbindAction(attacks[i].Value)
end
end)
else
wait(1)
print("Reached_2")
for i, v in pairs(attacks:GetChildren()) do
CAS:BindAction(attacks[i].Value,handleAction,true,pc[i])
end
end
end)
print("Ended")