Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why bool values (true/false) aren't changing?

Asked by 3 years ago
Edited 3 years ago

Hi

So I was working on a horror game and I got a problem...

Entire script works and it prints out 1/2 but one and two variables which are boolion values variables don't change.

Bascially whole script is working but the boolvalues (true/false) aren't changing

game.ReplicatedStorage.AddChildren.OnServerEvent:Connect(function(player, num, val)
    local value = tostring(num)
    local one = game.Workspace.Children1
    local two = game.Workspace.Children2

    if num == 1 then
        if val == true then
            print("1")
            one.Value = true -- this isn't working for some reason
        elseif val == false then
            print("2")
            one.Value = false -- this isn't working for some reason
        end
    elseif num == 2 then
        if val == true then
            print("1")
            two.Value = true -- this isn't working for some reason
        elseif val == false then
            print("2")
            two.Value = false -- this isn't working for some reason
        end
    end
end)

There are no errors on the output.

0
Is this a local or normal script? johnoscarbhv1 137 — 3y
0
server sided / normal ErktikyYT 89 — 3y
0
Are there any errors and are you sure that the Instance is a boolean value and not any other value JustinWe12 723 — 3y
0
There are no errors as I said in the post and yes, I am scripting for 2 years so far and it's not my first time dealing with that problem and I still have no idea why is that happening. ErktikyYT 89 — 3y

Answer this question