Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 20 Jun 2013 05:10 PM |
| How would I create a tool that upon the player left clicking, heals whoever hes clicking on and upon right clicking, heals themselves? I'm not asking for the script, I would prefer to do it myself. |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 20 Jun 2013 05:13 PM |
Something like this in a localscript in a tool:
local Tool = script.Parent
Tool.Equipped:connect(function(Mouse) Mouse.Button1Down:connect(function() local Target = Mouse.Target local Humanoid = Target.Parent:FindFirstChild("Humanoid") if Humanoid then Humanoid.Health = Humanoid.MaxHealth end end) Mouse.Button2Down:connect(function() local Humanoid = game.Players.LocalPlayer.Character.Humanoid Humanoid.Health = Humanoid.MaxHealth end) end) |
|
|
| Report Abuse |
|
|
swmaniac
|
  |
| Joined: 28 Jun 2008 |
| Total Posts: 15773 |
|
|
| 20 Jun 2013 05:23 PM |
That's the basics at least. Some suggestions for additions:
1) Maximum range 2) Setting the mouse's icon to something other than the default. 3) Reload time 4) Raycasting so you can't heal through walls. |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 20 Jun 2013 05:47 PM |
| Oh jeez... I would need help with all that. I know I can do the second one and I inserted the third one already. I know for the first one you need to use magnitude but i dont know how, and the fourth one I dont know how to do at all. |
|
|
| Report Abuse |
|
|