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

Script not changing BoolValues when prompted?

Asked by
RSoMKC 45
10 years ago

Any idea why newCheck and posCheck do not change when prompted?

newCheck = script.Parent.New
posCheck = script.Parent.Parent.Window.Detect.Bool
greenLight = script.Parent.Parent.Window.pRemain
detector = script.Parent.Parent.Window.Detect
finish = script.Parent.Parent.Window.End

if newCheck.Value == true then
    script.Parent.Humanoid:MoveTo(detector.Position, detector)
end

function detection(hit)
    newCheck.Value = false
    posCheck.Value = true
    if greenLight == 0 then
        script.Parent.Humanoid:MoveTo(finish.Position, finish)
    end
detector.Touched:connect(detection)
end
1
Never mind my solution. What you had was right. It actually appears that the MoveTo function is not properly working at the moment. RedCombee 585 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

This might work? Worth a try

newCheck = script.Parent.New
posCheck = script.Parent.Parent.Window.Detect.Bool
greenLight = script.Parent.Parent.Window.pRemain
detector = script.Parent.Parent.Window.Detect
finish = script.Parent.Parent.Window.End

if newCheck.Value == true then
    script.Parent.Humanoid:MoveTo(detector.Position, detector)
end

function detection(hit)
    newCheck.Value = false
    posCheck.Value = true
    if greenLight == 0 then
        script.Parent.Humanoid:MoveTo(finish.Position, finish)
    end
end
detector.Touched:connect(detection) -- put event listener outside function

Ad

Answer this question