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

"Error" making no sense??

Asked by
korj5 0
8 years ago
function walkTo(point)
    if workspace.NationalAssemblyAlarm.Toggle == true then
        script.Parent.Humanoid:MoveTo(point+Vector3.new(-43,226(-distanceAway*10,distanceAway*10)/10  ,  0.9(-distanceAway*10,distanceAway*10)/10  ,  1.445(-distanceAway*10,distanceAway*10)/10))
    else
    script.Parent.Humanoid:MoveTo(point+Vector3.new(math.random(-distanceAway*10,distanceAway*10)/10,math.random(-distanceAway*10,distanceAway*10)/10,math.random(-distanceAway*10,distanceAway*10)/10))
    repeat wait(0.5) timer = timer + 0.5
    until timer > timeout or (script.Parent:FindFirstChild("Torso") and (point - script.Parent.Torso.Position).magnitude < walkTolerance and nearestPoint() == point)
    if timer > timeout then
        script.Parent.Humanoid.Jump = true
    end 
    calculatePath(nearestPoint())
end

* 00:05:30.352 - Workspace.Bots..WalkySimple:41: ')' expected near '(' *

How I'm doing wrong?

1 answer

Log in to vote
0
Answered by
jakedies 315 Trusted Moderation Voter Administrator Community Moderator
8 years ago
Edited 8 years ago

You have a couple of mistakes:

if workspace.NationalAssemblyAlarm.Toggle == true then

should be

if workspace.NationalAssemblyAlarm.Toggle.Value == true then As Toggle is (most likely) a BoolValue.

Here:

script.Parent.Humanoid:MoveTo(point+Vector3.new(-43,226(-distanceAway*10,distanceAway*10)/10 , 0.9(-distanceAway*10,distanceAway*10)/10 , 1.445(-distanceAway*10,distanceAway*10)/10))

You're trying to multiply a 'formatted' number without using the multiplication operator. This is probably what you intended to do:

script.Parent.Humanoid:MoveTo(point+Vector3.new(-43226*(-distanceAway*10,distanceAway*10)/10 , 0.9*(-distanceAway*10,distanceAway*10)/10 , 1.445*(-distanceAway*10,distanceAway*10)/10))

And that is (hopefully) all the problems you have. All the ones I found at a quick glance, anyways.

0
According to the boolvalue, I always forget to add Value heh.. Thank you so much. korj5 0 — 8y
Ad

Answer this question