|
| 08 Mar 2012 05:07 PM |
function onTouched(Part) math.random(1,3) Workspace.game.morph.findFirstChild("telemon") Workspace.game.morph.findFirstChild("sorcus") Workspace.game.morph.findFirstChild("stickmasterluke") end
script.Parent.Touched:connect(onTouched)
I just learned scripting, please be gentle.
|
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 08 Mar 2012 05:08 PM |
| Can't fix, this script has no obvious intentions. |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2012 05:09 PM |
| I tried to make a script that would randomly morph you on touch, the children were the scripts |
|
|
| Report Abuse |
|
|
johnhugh
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 1971 |
|
|
| 08 Mar 2012 05:10 PM |
| What do you WANT the script to do... because right now you are just TRYING to state a fact... |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2012 05:10 PM |
| the morphs are the children |
|
|
| Report Abuse |
|
|
johnhugh
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 1971 |
|
|
| 08 Mar 2012 05:13 PM |
function onTouched(Part) x = math.random(1,3) if x == 1 then local T = Workspace.game.morph.findFirstChild("telemon") (figure this out) elseif x == 2 then local So = Workspace.game.morph.findFirstChild("sorcus") (figure this out) elseif x == 3 then local St = Workspace.game.morph.findFirstChild("stickmasterluke") (figure it out) end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
johnhugh
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 1971 |
|
|
| 08 Mar 2012 05:14 PM |
Oh, wait sorry use this one:
function onTouched(Part) x = math.random(1,3) if x == 1 then local T = Workspace.game.morph:findFirstChild("telemon") (figure this out) elseif x == 2 then local So = Workspace.game.morph:findFirstChild("sorcus") (figure this out) elseif x == 3 then local St = Workspace.game.morph:findFirstChild("stickmasterluke") (figure it out) end script.Parent.Touched:connect(onTouched)
With functions, such as findFirstChild, they start with : and not . so :findFirstChild("") and not .findFirstChild("") |
|
|
| Report Abuse |
|
|
| |
|
johnhugh
|
  |
| Joined: 26 Mar 2009 |
| Total Posts: 1971 |
|
|
| 08 Mar 2012 05:17 PM |
It's ok, I was worse when i started :3 Also, for the other part, go into more detail abut how the items in Workspace are arranged, and maybe someone can make it for you. |
|
|
| Report Abuse |
|
|