I Want Rock To Pass But The Coal To Get Teleported Some Place Else I Made The Script But, It Won't Work Any Help?
positions = {[1] = -32.012, 2.03, -48.3,
[2] = -33.302, 2.03, -48.3,
[3] = -34.352, 2.03, -48.3,
[4] = -35.412, 2.03, -48.3,
[5] = -36.472, 2.03, -48.3}
function onTouched(hit)
if hit.Name == "Coal" then
hit.Position = (positions[math.random(1, #positions)])
elseif hit.Name == "CleanedCoal" then
hit.Position = (positions[math.random(1, #positions)])
elseif hit.Name == "CleanedPolishedCoal" then
hit.Position = (positions[math.random(1, #positions)])
end
end
script.Parent.Touched:connect(onTouched)
