What is wrong with my math.random script? I'm very new to math.random and I know I'm completely wrong. Basically I want to make it so if the number 1 or 10 is picked in a random selection out of 10 numbers (1-10) then the name of a part in the model the mesh part is in changes. Basically I also only want this to activate if the part is touched by one of the parts listed. Any ideas?
function OnTouched(Part)
if Part.Name == 'F1' or Part.Name == 'F2'or Part.Name == 'F3' or Part.Name == 'F4' or Part.Name == 'F5' or Part.Name == 'F6' or Part.Name == 'F7' or Part.Name == 'F8' or Part.Name == 'F9' or Part.Name == 'F10' or Part.Name == 'B1' or Part.Name == 'B2' or Part.Name == 'B3' or Part.Name == 'B4' or Part.Name == 'B5'then
local mag = Part.Velocity.Magnitude
if mag > 30 and mag < 60 then
math.randomseed(tick())
for _ = 1, 10 do
print(math.random(10))
wait(1)
end
if math.random == 1 or 10 then
script.Parent.Parent.FR.Name = "DFR"
end
I know it's a mess but hopefully you can understand.

3 comments
I put a lot of time into this answer
Thank you so much!
Your welcome