|
| 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 |
|
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 05 Jul 2015 01:46 AM |
| script.Parent.Selected:connect(functionname) -- welcomez |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|