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: asdf

Previous Thread :: Next Thread 
T3XT is not online. T3XT
Joined: 25 Jul 2011
Total Posts: 9233
11 Jul 2012 09:41 PM
Not just in their Inventory but actually holding.
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
11 Jul 2012 09:48 PM
If the player has a tool equipped, then the tool will be in the Character in the workspace. e.g

p = Worskpace.PLAYERNAME:GetChildren()

for i = 1,#p do
if p[i]:IsA("Tool") then
print(p[i].Name)
end
end
Report Abuse
T3XT is not online. T3XT
Joined: 25 Jul 2011
Total Posts: 9233
11 Jul 2012 10:31 PM
^
Thanks

But I want it to be applicable to any player, not specifically [Playername].
Report Abuse
rayoma is not online. rayoma
Joined: 13 Nov 2009
Total Posts: 1911
11 Jul 2012 10:33 PM
Then make it a function...

    function findCurrentTool(name)
        p = Worskpace[name]:GetChildren()
        for i = 1,#p do
            if p[i]:IsA("Tool") then
                return p[i]
            end
        end
    end
Report Abuse
T3XT is not online. T3XT
Joined: 25 Jul 2011
Total Posts: 9233
11 Jul 2012 10:38 PM
Thanks.
Report Abuse
T3XT is not online. T3XT
Joined: 25 Jul 2011
Total Posts: 9233
11 Jul 2012 11:26 PM
Okay let me be a little more specific to the scenario since this calls for a very specific script. I'm sorry if this sounds like a request but I really need this and it's really simple.

I want a script that will change the Text of the parent TextButton to the name of the currently equipped tool.

Thanks in advance.
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
12 Jul 2012 12:05 AM
This reminds Me of my old Gun Gui
Report Abuse
T3XT is not online. T3XT
Joined: 25 Jul 2011
Total Posts: 9233
12 Jul 2012 03:49 PM
Bump
Report Abuse
T3XT is not online. T3XT
Joined: 25 Jul 2011
Total Posts: 9233
12 Jul 2012 06:27 PM
Umm...bump
Report Abuse
WhoBloxedWho is online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
12 Jul 2012 07:36 PM
repeat wait(0) until game.Players.LocalPlayer
local TextLabel = script.Parent
local Player = game.Players.LocalPlayer

while wait(0) do
for i,v in pairs(Player.Character:GetChildren()) do
if v:IsA("Tool") then
TextLabel.Text = v.Name
else
TextLabel.Text = ""
end
end
end
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