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: Activated Tool

Previous Thread :: Next Thread 
RoAnt is not online. RoAnt
Joined: 14 Jul 2008
Total Posts: 16794
17 Jan 2012 10:33 PM
What define the mouse position once it is clicked in tool?
I'm better at hopperbin than tool.



script.Parent.Activated:connect(function()
--[[mouse ??? ]]--
end)
Report Abuse
SecureDatabase is not online. SecureDatabase
Joined: 12 Dec 2010
Total Posts: 392
17 Jan 2012 10:34 PM
tool.Selected:connect(function()
print("Tool was clicked")
end)
Report Abuse
RoAnt is not online. RoAnt
Joined: 14 Jul 2008
Total Posts: 16794
17 Jan 2012 10:36 PM
Selected is not in Tool.
Plus, that doesn't show the part where mouse was being clicked.
It online prints if the hopperbin was selected.
I'm talking about Tools here.
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
17 Jan 2012 10:36 PM
nope:

tool.Selected:connect(function(mouse)
mouse.Button1Down:connect(function() print("clicked") end)
end)
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
17 Jan 2012 10:38 PM
oh, i thought by tool u meant hopper bin, cuz quenty used hopperbin event
Report Abuse
SecureDatabase is not online. SecureDatabase
Joined: 12 Dec 2010
Total Posts: 392
17 Jan 2012 10:38 PM
tool.Selected:connect(function(mouse)
mouse.Button1Down:connect(function()
if mouse.Object then
print("clicked"..mouse.Object.Name)
else
print("No target")
end
end)
end)
Report Abuse
SecureDatabase is not online. SecureDatabase
Joined: 12 Dec 2010
Total Posts: 392
17 Jan 2012 10:38 PM
tool.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
if mouse.Object then
print("clicked"..mouse.Object.Name)
else
print("No target")
end
end)
end)

Sorry.
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
17 Jan 2012 10:40 PM
whats the difference between mouse.Target and mouse.Object?
Report Abuse
RoAnt is not online. RoAnt
Joined: 14 Jul 2008
Total Posts: 16794
17 Jan 2012 10:54 PM
If the direction you clicked is in front of you, it will call the function fire()?
Using the Activated event, not the Equipped.

function onActivated()
local character = Tool.Parent;
local humanoid = character.Humanoid
if not humanoid then
print("Humanoid not found")
return
end
local targetPos = humanoid.TargetPoint
local lookAt = (targetPos - character.Head.Position).unit
if --[[Help on this. What do I use?]]-- then
fire(lookAt)
end
Tool.Enabled = true
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