|
| 12 May 2014 04:13 PM |
What approach does SML use with his Swuvle (From Underground War) This is all I can think of 1.) Somehow check if the swuvle is touching something called 'Dirt' when Tool is Enabled (maybe coroutine) 2.) After Tool is enabled, Get target from Mouse and Magintude from target and if Magnitude is within a certain distance, Do an action 3.) Gui Buttons (so unlikely and inefficient)
==Redlo43 Forum Acc== |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
| |
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 12 May 2014 04:18 PM |
| Sword code, and Dirt has health too. That's probably the easiest way. Every dirt block has a certain amount of health, and the swuvle strike always takes out a certain amount. Every time the health changes, the block updates its transparency and if it "dies", it deletes itself. It'd require at least two parts, assuming the dirt was a Torso, and not a separate non-Torso or non-Head part. I've done something very similar for simple window destruction, whereby the window was an NPC with health and one shot from a peashooter will kill it. |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 04:18 PM |
Well for Touched, I don't get how he lets it so that he resets the Touch. I have tried 1 before, but unless you stop touching it (TouchEnded) the Touched event will not fire anymore because it is still touching. But for sml, it does reset somehow. |
|
|
| Report Abuse |
|
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 12 May 2014 04:20 PM |
| Or you can use method 2(?), whereby the sword checks on a Click whether it's Touching a dirt block. It gets swung, and it isn't too hard to create a detector piece welded on invisibly above the character's head or something. |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 04:26 PM |
Oh I see where I can go with the welding on the Character's head idea I can manipulate bools based on the events like
thepart.Touched:connect(function(p) if p.Name == 'Dirt' then PlEnabled = true end) thepart.TouchEnded:connect(p) if p.Name == 'Dirt' then PlEnabled = false end)
and then use conditional statments for the enabled part that way it can do it as many times as it wants to without actually having to reset Touched with your character |
|
|
| Report Abuse |
|
|