What do you want to achieve? Keep it simple and clear!
I want to change the “doingTask” bool value to true
What is the issue?
it remains false which i don’t know why
What solutions have you tried so far?
i looked through the roblox fourm already but couldn’t understand how their similar problems could be connected to mine because of the complexity of the answers and the situations they were in i also tried asking chatgpt but it couldn’t help me i also looked for similar questions in stack overflow but i couldn’t understand those either.
local function heartbeat()
hunger = hunger - hungerRate
if hunger == 0 then
hum.Health = 0
end
if currentTask == tasks[2] then
if doingTask == false then
print(doingTask)
cutTree()
doingTask = true
end
end
end
I assume doingTask is the bool value. You can only access any value object’s value but doing ValueObject.Value. Therefore, the code would be:
local function heartbeat()
hunger = hunger - hungerRate
if hunger == 0 then
hum.Health = 0
end
if currentTask == tasks[2] then
if doingTask.Value == false then
print(doingTask.Value)
cutTree()
doingTask.Value = true
end
end
end
that didnt work really i found a sort of solution but im not satisified with it i basically made the function change the value of the bool value and that worked