generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Fix this, or re-write if you know what Im getting at.

Previous Thread :: Next Thread 
mrpricetoyou is not online. mrpricetoyou
Joined: 25 Nov 2011
Total Posts: 5160
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 is not online. HatHelper
Top 25 Poster
Joined: 02 Mar 2009
Total Posts: 46305
08 Mar 2012 05:08 PM
Can't fix, this script has no obvious intentions.
Report Abuse
mrpricetoyou is not online. mrpricetoyou
Joined: 25 Nov 2011
Total Posts: 5160
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 is not online. 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
mrpricetoyou is not online. mrpricetoyou
Joined: 25 Nov 2011
Total Posts: 5160
08 Mar 2012 05:10 PM
the morphs are the children
Report Abuse
johnhugh is not online. 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 is not online. 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
mrpricetoyou is not online. mrpricetoyou
Joined: 25 Nov 2011
Total Posts: 5160
08 Mar 2012 05:15 PM
wow I was way off...
Report Abuse
johnhugh is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image