Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

"Error" making no sense??

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

✓ Accepted answer

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.

1 comment

0

According to the boolvalue, I always forget to add Value heh.. Thank you so much.

This discussion is preserved as it was. New answers, comments, and votes are closed.