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 » Scripters
Home Search
 

Re: TYPE

Previous Thread :: Next Thread 
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
07 Mar 2015 11:54 AM
How can i do FindFirstChild() of type Model
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
07 Mar 2015 11:55 AM
Model:FindFirstChild()
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
07 Mar 2015 11:59 AM
I am trying to find a child of the character which is a model

so?

Char:FindFirstChild(model)
Report Abuse
UnlimitedKoradoxic is not online. UnlimitedKoradoxic
Joined: 14 Jul 2011
Total Posts: 452
07 Mar 2015 12:02 PM
You have to define character and model

I wanna be a future game dev :3
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
07 Mar 2015 12:03 PM
Like?

I have already defined character, but i want it to search and if there is a model then assign the variable to that
Report Abuse
UnlimitedKoradoxic is not online. UnlimitedKoradoxic
Joined: 14 Jul 2011
Total Posts: 452
07 Mar 2015 12:05 PM
if not char:FIndFirstChild("Model") then
print("No model :P")
else
-- do stuff
end

I wanna be a future game dev :3
Report Abuse
UnlimitedKoradoxic is not online. UnlimitedKoradoxic
Joined: 14 Jul 2011
Total Posts: 452
07 Mar 2015 12:06 PM
local model = char:FindFirstChild("Model")

I wanna be a future game dev :3
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
07 Mar 2015 12:06 PM
then how do i set the model it finds asa variable
Report Abuse
UnlimitedKoradoxic is not online. UnlimitedKoradoxic
Joined: 14 Jul 2011
Total Posts: 452
07 Mar 2015 12:09 PM
if not char:FIndFirstChild("Model") then
print("No model :P")
else
model = char:FindFirstChild("Model")
end

I wanna be a future game dev :3
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
07 Mar 2015 12:09 PM
They already did that.
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
07 Mar 2015 12:12 PM
1. You can't set a variable to be anything but a pointer/reference to the model
2. You can't set a variable to change the model
3. You can only execute methods/grab properties from the variable
4. :FindFirstChild() works on every service/object (for it is derived by superclass Instance)
5. :FindFirstChild(String object) requires a String.
6. You can also... game.FindFirstChild(Workspace.Model, "Head")
Report Abuse
Froast is not online. Froast
Joined: 12 Mar 2009
Total Posts: 3134
07 Mar 2015 12:15 PM
In case the model isn't named 'Model':

FindFirstChildOfClass = function(object,class)
for _,child in next, object:GetChildren() do
if child:IsA(class) then
return child
end
end
end

local model = FindFirstChildOfClass(char,'Model')
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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