local var = true
if var then
event:FireAllClients({
RETURN = "VARTRUE",
VALUE = false
})
else
event:FireAllClients({
RETURN = "VARFALSE",
VALUE = true
})
end
(Value should be true for var = false and false for var = true)
The issue is that var is being set to false even though I have defined it as true. There are no other parts in the script setting the value to false. Does anyone know why?
Assuming event is firing a remote, and value is a ValueBase’s value, then this code would be equivalent correct?
local var = true
if var then
var = false
print("variable changed to false")
else
VALUE = true
print("variable changed to true")
end
This works completely fine and is seemingly equivalent to what you have posted, just without ValueBase changes and remotes. Is it possible that you could provide a less shortened version - because nothing here seems to be incorrect, unless I’m misunderstanding your question.