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

How would i use math.random()with cframe manipulation?

Asked by 6 years ago
Edited 6 years ago
1script.Parent.Touched:Connect(function(hit)
2 
3if hit.Parent:FindFirstChild("HumanoidRootPart") then
4 
5hit.Parent.HumanoidRootPart.CFrame = CFrame.new(math.random(?))
6 
7end
8 
9end)
0
more specification please theking48989987 2147 — 6y
0
ye sorry the positioning the the script is not good but what i want to happen is when i touch the part i get randomly teleported to 6 different locations Gameplayer365247v2 1055 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

To move the position of CFrame, it requires 3 values.
So you could do the following;

1CFrame.new(math.random(-100,100),math.random(-100,100),math.random(-100,100))
0
i dont want it to be any number between them, i want it to be 6 different locations, 6 specific Gameplayer365247v2 1055 — 6y
0
Then make a table holding the specific CFrame values MRbraveDragon 374 — 6y
Ad

Answer this question