How and where would i put a math.random script in here because i want it to go in random locations when i touch it.
function onTouched(hit) script.Parent.Position=Vector3.new(0,0,0) script.Parent.Anchored=true end script.Parent.Touched:connect(onTouched)
You would put it in any of the elements of the new Vector3 value.
function onTouched(hit) script.Parent.Position = Vector3.new(math.random(-10,10),math.random(1,5),math.random(-20,20)) script.Parent.Anchored = true end script.Parent.Touched:connect(onTouched)
The part will re-position itself in:
x-axis: Between -10 and 10
y-axis: Between 1 and 5
z-axis: Between -20 and 20