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: Quick Question

Previous Thread :: Next Thread 
ZeroHour66 is not online. ZeroHour66
Joined: 14 Sep 2013
Total Posts: 1511
05 Jul 2015 12:56 AM
Is there a way to detect if the player has a tool equipped when they click on a part?
Report Abuse
Lucas1270z is not online. Lucas1270z
Joined: 27 Feb 2013
Total Posts: 439
05 Jul 2015 12:57 AM
yes
Report Abuse
ZeroHour66 is not online. ZeroHour66
Joined: 14 Sep 2013
Total Posts: 1511
05 Jul 2015 01:24 AM
Sorry, I was going for a helpful answer. Not a sarcastic one.

How would I go about detecting whether the player has a tool equipped when they click on a part?
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
05 Jul 2015 01:26 AM
script.Parent.ClickDetector.MouseClick:connect(function(player)
--find out if they have a tool in their charcter
end)


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
ZeroHour66 is not online. ZeroHour66
Joined: 14 Sep 2013
Total Posts: 1511
05 Jul 2015 01:44 AM
The part you didn't put in is the part I'm having trouble with. I know how to set up a basic function.
Report Abuse
FearlessBiscuit is not online. FearlessBiscuit
Joined: 16 Jun 2013
Total Posts: 1157
05 Jul 2015 01:46 AM
script.Parent.Selected:connect(functionname) -- welcomez
Report Abuse
Wishworth is not online. Wishworth
Joined: 27 Jun 2015
Total Posts: 36
05 Jul 2015 01:50 AM
zero if you know how to setup a basic function then you shouldnt need baby steps
well what ever

ClickDetector.MouseClick:connect(function()
if character:findFirstChild(tool.Name) then
print("Player has tool equipped.")
end
end)
Report Abuse
ZeroHour66 is not online. ZeroHour66
Joined: 14 Sep 2013
Total Posts: 1511
05 Jul 2015 01:57 AM
It's not that I needed baby steps, It's just that no one before you actually helped in any way
Report Abuse
SolarStuds is not online. SolarStuds
Joined: 19 Sep 2013
Total Posts: 62
05 Jul 2015 02:07 AM
--To check if player touched the part

local Part = game.Workspace.PartClick

Part.ClickDetector.MouseClick:connect(function()
print("Player was found")
end)


Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
05 Jul 2015 02:09 AM
local ClickDetector = script.Parent

ClickDetector.MouseClicked:connect(function(Player)
local Character = Player.Character
for _, tool in pairs(Character:GetChildren()) do
if tool.ClassName == "Tool" then
print("Something Equipped")
end
end
end)
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