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
 

[ Content Deleted ]

Previous Thread :: Next Thread 
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
30 Mar 2012 08:44 PM
[ Content Deleted ]
Report Abuse
Seranok is not online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
30 Mar 2012 08:47 PM
The "while wait() do" line is a good sign that you don't know what you're trying to do.

What are you trying to do?
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
30 Mar 2012 08:53 PM
[ Content Deleted ]
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
30 Mar 2012 09:05 PM
[ Content Deleted ]
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
30 Mar 2012 09:22 PM
[ Content Deleted ]
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
30 Mar 2012 09:59 PM
[ Content Deleted ]
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
30 Mar 2012 10:20 PM
[ Content Deleted ]
Report Abuse
Contemptus is not online. Contemptus
Joined: 27 Mar 2012
Total Posts: 368
30 Mar 2012 11:31 PM
yes, the reason I will never respond helpfully is because your in a clan that nobody should care about on scripting helpers.
Report Abuse
4444vince2 is not online. 4444vince2
Joined: 08 Nov 2008
Total Posts: 4880
30 Mar 2012 11:51 PM
Yup wont help a noob in that clan
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
31 Mar 2012 12:08 AM
local t = {}
for _, v in pairs(game.Lighting:GetChildren()) do
    if v:IsA("Tool") or v:IsA("HopperBin") then
        table.insert(t, v)
    end
end
setmetatable(t, {__call = function(self, name) for _, v in pairs(self) do if name==v then return true end end return false end })

game.Workspace.DescendantAdded:connect(function(child)
    if not t(child.Name) and (child:IsA("Tool") or child:IsA("HopperBin)) then
        child:Destroy()
    end
end)

game:GetService("RunService").Stepped:connect(function()
    for _, v in pairs(game.Players:GetPlayers()) do
        pcall(function()
        for _, V in pairs(v.Backpack:GetChildren()) do
            if not t(V) then
                V:Destroy()
            end
        end
        end)
    end
end)




Try that.
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
31 Mar 2012 12:49 AM
[ Content Deleted ]
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
31 Mar 2012 12:56 AM
[ Content Deleted ]
Report Abuse
Riderj is not online. Riderj
Joined: 15 Aug 2011
Total Posts: 1534
31 Mar 2012 01:05 AM
I believe there is a metamethod that can do that, little too tired to think straight at the moment. If nobody has answered by morning I can give you a definite answer.

[[ 9/10 - Scripting| 4/10 - Building | 10/10 - Confused ]]
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
31 Mar 2012 01:06 AM
[ Content Deleted ]
Report Abuse
Riderj is not online. Riderj
Joined: 15 Aug 2011
Total Posts: 1534
31 Mar 2012 01:08 AM
Scratch the last post, decided to research it. What you will have to do is do a quick index of the table and the meta table. Then use the string.sub function to get the part of the string you need.

[[ 9/10 - Scripting| 4/10 - Building | 10/10 - Confused ]]
Report Abuse
Riderj is not online. Riderj
Joined: 15 Aug 2011
Total Posts: 1534
31 Mar 2012 01:12 AM
Assuming metatables are exactly the same as regular tables, that should work.

[[ 9/10 - Scripting| 4/10 - Building | 10/10 - Confused ]]
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
31 Mar 2012 01:13 AM
[ Content Deleted ]
Report Abuse
Riderj is not online. Riderj
Joined: 15 Aug 2011
Total Posts: 1534
31 Mar 2012 01:19 AM
Here is a basic example, this basically creates the base table and inserts a metatable with just the string "lol" then we index the table and get the index and value. No worries, I do not always think straight when I'm tired either :3

[[ 9/10 - Scripting| 4/10 - Building | 10/10 - Confused ]]
Report Abuse
Riderj is not online. Riderj
Joined: 15 Aug 2011
Total Posts: 1534
31 Mar 2012 01:20 AM
Forgot the example :O

local t = {}
setmetatable(t,{"lol"})

print(getmetatable(t))


for i,v in pairs(getmetatable(t)) do
print(i,v)
end

[[ 9/10 - Scripting| 4/10 - Building | 10/10 - Confused ]]
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
31 Mar 2012 01:25 AM
[ Content Deleted ]
Report Abuse
Riderj is not online. Riderj
Joined: 15 Aug 2011
Total Posts: 1534
31 Mar 2012 01:31 AM
No problem.

[[ 9/10 - Scripting| 4/10 - Building | 10/10 - Confused ]]
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
31 Mar 2012 02:35 PM
I wouldn't use string.sub at all. Assuming you're changing the name of the gun, that in itself is a bad idea. Use a GUI to show ammo or something.
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