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: How to avoid this error?

Previous Thread :: Next Thread 
pokymon92 is not online. pokymon92
Joined: 24 Jan 2010
Total Posts: 53
27 Dec 2013 03:16 PM
In the output of the script:

------------------------------------------------
script.Parent.Touched:connect(function(toucher)
if game.Players:findFirstChild(toucher.Parent.Name) then
a = math.random(1,100)
if a == 1 then
print("A Wild Pokemon Appeared!")
toucher.Parent.Torso.CFrame = workspace.Arena1.Start1.CFrame+Vector3.new(0,5,0)
end
end
end)
------------------------------------------------

I keep getting "Touched is not a valid member of Model", how do I avoid this error and why do I encounter this problem?
Report Abuse
Alex4897 is not online. Alex4897
Joined: 06 Aug 2008
Total Posts: 14517
27 Dec 2013 03:19 PM
Is your script's parent the model itself or a part?

I am an eggspert in the eggcelent art of egg puns.
Report Abuse
pokymon92 is not online. pokymon92
Joined: 24 Jan 2010
Total Posts: 53
27 Dec 2013 03:20 PM
it's a model.
Report Abuse
Alex4897 is not online. Alex4897
Joined: 06 Aug 2008
Total Posts: 14517
27 Dec 2013 03:22 PM
Well the issue is that your trigger is when someone touches the model. Nothing touches models, touched events only work on parts.

I am an eggspert in the eggcelent art of egg puns.
Report Abuse
pokymon92 is not online. pokymon92
Joined: 24 Jan 2010
Total Posts: 53
27 Dec 2013 03:24 PM
Oh I see, thanks!
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