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

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

Asked by 3 years ago
Edited 3 years ago
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

0
Until is a contextual conditional keyword, therefore, a comparison operator is required in this situation: == Ziffixture 6913 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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

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. Ziffixture 6913 — 3y
Ad

Answer this question