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: I need help making an assign class script.

Previous Thread :: Next Thread 
drc3 is not online. drc3
Joined: 14 Aug 2009
Total Posts: 1284
22 Feb 2016 03:43 AM
The last character in the script that says "Naruto" is the name of a frame. However, I have multiple frames with different names, and I need this script to be able to search all the frames for a tool. I am not sure how to do this can someone please help me?

Thank you!



player = script.Parent.Parent.Parent
backpack = player.Backpack

function chooseClass(class)
for i, v in pairs(backpack:GetChildren()) do v:remove() end
for i, v in pairs(class:GetChildren()) do
if v:IsA("Tool") then
v:clone().Parent = backpack
elseif v:IsA("HopperBin") then
v:clone().Parent = backpack
end
end
script.Parent.Characters.Naruto.Visible = true
wait(0.01)
script.Parent.Characters.Naruto.Visible = false
end

for i, v in pairs(script.Parent.Characters.Naruto:GetChildren()) do
v.MouseButton1Up:connect(function () chooseClass(v) end)
end
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
22 Feb 2016 05:20 AM
HopperBins are bad
Report Abuse
oni0n is not online. oni0n
Joined: 04 Nov 2012
Total Posts: 2975
22 Feb 2016 05:22 AM
^

use the Tool instance instead



#code cout << "Truth shall sit upon the lips of a dying man" << endl; //Matthew Arnold
Report Abuse
checkplate is not online. checkplate
Joined: 05 Jan 2016
Total Posts: 1379
22 Feb 2016 05:41 AM
Why not actually use classes?
Report Abuse
drc3 is not online. drc3
Joined: 14 Aug 2009
Total Posts: 1284
22 Feb 2016 07:30 PM
Can someone make me a script that assigns a weapon/tool when a gui button is clicked then? Please and thank you!
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