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

its supposed to add random numbers to its position instead its an error?

workspace:WaitForChild("defaultkid99")
repeat 
    script.Parent.Position = script.Parent.Position+Vector3.new(math.random,math.random,math.random)
until script.Parent.Position = defaultkid99.Torso.Position

it tells me expected identifier when parsing epression instead got =

alright so i have a new script

workspace:WaitForChild("defaultkid99")
repeat 
	script.Parent.Position = script.Parent.Position+Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))
until script.Parent.Position == defaultkid99.UpperTorso.Position

but it still doesnt work but gives me a different error

1 comment

0

Until is a contextual conditional keyword, therefore, a comparison operator is required in this situation: ==

1 answer

as i know you need to add 2 numbers in math.random so it will be math.random({minimum number}, {maximum number})

1 comment

0

By default, the random function of the math class will generate a PRNG between 0-1. Without implying the function, you'll be reference the function Instance.

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