|
| 03 Jul 2013 08:43 AM |
It's a script so the car tire will adapted based on the brick material the wheels touch, It will run, but the script doesn't change the friction for some reason?
Here is the script:
while true do wait(.25) function findRandomChild(model) return A == script.Parent.Parent.Wheels:children()[math.random(1,#model:children())] end function onTouch(hit) if hit.Material == "Grass" or "Slate" or "Ice" then local children = Workspace:GetChildren() for i = 1, #children do children[i].Friction = ".25" end end if hit.Material == "Concrete" then local children = Workspace:GetChildren() for i = 1, #children do children[i].Friction = ".75" end else children[i].Friction = ".50" script.Parent.Touched:connect(onTouch) end end end
|
|
|
| Report Abuse |
|
|
|
| 03 Jul 2013 09:01 AM |
Here is a fix on what you did wrong, the script will still not work because you are missing something, something to call the other functions and I do not know what this script is accualy supposed to do:
function findRandomChild(model) return A == script.Parent.Parent.Wheels:GetChildren()[math.random(1,#model:GetChildren())] end function onTouch(hit) if hit.Material == "Grass" or "Slate" or "Ice" then local children = Workspace:GetChildren() for i = 1, #children do children[i].Friction = .25 end end if hit.Material == "Concrete" then local children = Workspace:GetChildren() for i = 1, #children do children[i].Friction = .75 end else children[i].Friction = .50 script.Parent.Touched:connect(onTouch) end end while wait(.25) do --something here end |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2013 09:47 AM |
| Bump, someone help please? |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2013 09:48 AM |
| Did not I just help you a bit? I know it is not fully working but I have removed the errors. |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2013 09:54 AM |
| A slight bit, but I need it to work :/ |
|
|
| Report Abuse |
|
|
| |
|
| |
|