Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

script.Parent.Touched:Connect(function(hit)

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

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

end

end)

2 comments

0

more specification please

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

1 answer

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))

2 comments

0

i dont want it to be any number between them, i want it to be 6 different locations, 6 specific

0

Then make a table holding the specific CFrame values

This discussion is preserved as it was. New answers, comments, and votes are closed.