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 5 years ago
Edited 5 years ago
script.Parent.Touched:Connect(function(hit)

if hit.Parent:FindFirstChild("HumanoidRootPart") then

hit.Parent.HumanoidRootPart.CFrame = CFrame.new(math.random(?))

end

end)
0
more specification please theking48989987 2147 — 5y
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 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

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

CFrame.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 — 5y
0
Then make a table holding the specific CFrame values MRbraveDragon 374 — 5y
Ad

Answer this question