Can someone help me with teleporting NPCs to a map?
I tried using math.random(), but i got a error message, here's the code I used:
1 | local CTorso = Clone:FindFirstChild( "UpperTorso" ) or Clone:FindFirstChild( "Torso" ) |
2 | if Map:FindFirstChild( "Min" ) and Map:FindFirstChild( "Max" ) then |
3 | local Min = Map:FindFirstChild( "Min" ) |
4 | local Max = Map:FindFirstChild( "Max" ) |
5 | CTorso.CFrame = CFrame.new(math.random(Max.Position.X,Min.Position.X), math.random(Max.Position.Y,Min.Position.Y)+ 5 ,math.random(Max.Position.Z,Min.Position.Z)) |
7 | error ( "Min/Max Is Missing From Map" ) |
here's the error message I got
Can anyone help me?