|
| 22 Jul 2012 02:35 PM |
| Maybe you could add a new type of Script type, kind of like :FindFirstChild(InstanceName). It would be :FindFirstClass(InstanceClassName) Example: (Workspace has 1 Message), game.Workspace:FindFirstClass("Message").Name = "MessageName" (Workspaces Message is now MessageName) |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Jul 2012 02:42 PM |
| Follow me if your good at sword fighting i will show you who is boss. |
|
|
| Report Abuse |
|
|
| |
|
Kevin7704
|
  |
| Joined: 08 Jan 2009 |
| Total Posts: 5568 |
|
|
| 22 Jul 2012 02:47 PM |
| @bball why are you off topic |
|
|
| Report Abuse |
|
|
| |
|
kevin756
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 11244 |
|
|
| 23 Jul 2012 03:00 AM |
| game.Players.bballkyle15:Remove() |
|
|
| Report Abuse |
|
|
| |
|
fiCmds
|
  |
| Joined: 06 Aug 2012 |
| Total Posts: 25 |
|
| |
|
|
| 09 Aug 2012 02:41 PM |
| Thats LUA's job. Not Roblox. |
|
|
| Report Abuse |
|
|
kevin756
|
  |
| Joined: 13 Dec 2008 |
| Total Posts: 11244 |
|
| |
|
|
| 09 Aug 2012 03:16 PM |
Use a bindable function; it's a way of making your own. Lua/Roblox functions are actually just code called when it executes. plate = workspace:FindFirstChild("Baseplate") really is:
for i=1, #workspace:GetChildren() do if workspace:GetChildren()[i].Name == "Baseplate" then plate = workspace:GetChildren()[i] end end
A similar thing can be done with a bindable function. A function that prints how many classes the directory has is quite simple:
Function = Instance.new("BindableFunction",Workspace) --[[creates the bindable function into the workspace. Function can be named anything you want it to be]] Function.OnInvoke = function(classNameInput,directoryNameInput) local numClassesFound = 0 for i=1,#directoryNameInput:GetChildren() do if directoryNameInput:GetChildren()[i].ClassName == classNameInput then numClassesFound = numClassesFound + 1 end end print(numClassesFound) end -- Other code Function:Invoke(classnamehere,directorynamehere) --example: Function:Invoke(Part,Workspace)
|
|
|
| Report Abuse |
|
|