|
| 24 Jan 2015 11:33 AM |
handle = script.Parent sword = script.Parent.Parent["Iron Sword"] part1=sword.Part1 part2=sword.Part2 part3=sword.Part3 part4=sword.Part4 slash = true
function Weld(x,y) local W = Instance.new("Weld") W.Part0 = x W.Part1 = y local CJ = CFrame.new(x.Position) local C0 = x.CFrame:inverse()*CJ local C1 = y.CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = x end
function Get(A) if A.className == "Part" then Weld(script.Parent.Handle, A) A.Anchored = false else local C = A:GetChildren() for i=1, #C do Get(C[i]) end end end
function Finale() Get(script.Parent) end
script.Parent.Equipped:connect(Finale) script.Parent.Unequipped:connect(Finale) Finale() slash = true function Slash() sword.GripUp = Vector3.new(1, 1, 0) wait(0.1) sword.GripUp = Vector3.new(3, 1, 0) wait(0.1) sword.GripUp = Vector3.new(5, 1, 0) wait(0.1) sword.GripUp = Vector3.new(7, 1, 0) wait(0.1) sword.GripUp = Vector3.new(4, 1, 0) wait(0.1) sword.GripUp = Vector3.new(3, 1, 0) wait(0.1) sword.GripUp = Vector3.new(2, 1, 0) wait(0.1) sword.GripUp = Vector3.new(1, 1, 0) wait(0.1) sword.GripUp = Vector3.new(0, 1, 0) end
sword.Activated:connect(Slash)
sword.Part1.Touched:connect(function(hit) if slash == false then return end slash = false if hit.ClassName == "Part" and hit.Name ~= "Handle" and hit.Parent.Humanoid then hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - sword.Damage.Value wait(0.4) slash = true end end)
sword.Part4.Touched:connect(function(hit) if slash == false then return end slash = false if hit.ClassName == "Part" and hit.Name ~= "Handle" and hit.Parent.Humanoid then hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - sword.Damage.Value wait(0.4) slash = true end end)
The last 2 functions only work once. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
CronZero
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 6616 |
|
| |
|
|
| 24 Jan 2015 07:39 PM |
| What function might be "null'd" |
|
|
| Report Abuse |
|
|
| |
|
CronZero
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 6616 |
|
| |
|
| |
|
|
| 24 Jan 2015 07:54 PM |
New Script: handle = script.Parent sword = script.Parent.Parent["Iron Sword"] part1=sword.Part1 part2=sword.Part2 part3=sword.Part3 part4=sword.Part4 slash = true
function Weld(x,y) local W = Instance.new("Weld") W.Part0 = x W.Part1 = y local CJ = CFrame.new(x.Position) local C0 = x.CFrame:inverse()*CJ local C1 = y.CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = x end
function Get(A) if A.className == "Part" then Weld(script.Parent.Handle, A) A.Anchored = false else local C = A:GetChildren() for i=1, #C do Get(C[i]) end end end
function Finale() Get(script.Parent) end
script.Parent.Equipped:connect(Finale) script.Parent.Unequipped:connect(Finale) Finale() slash = true function Slash() sword.GripUp = Vector3.new(1, 1, 0) wait(0.1) sword.GripUp = Vector3.new(3, 1, 0) wait(0.1) sword.GripUp = Vector3.new(5, 1, 0) wait(0.1) sword.GripUp = Vector3.new(7, 1, 0) wait(0.1) sword.GripUp = Vector3.new(4, 1, 0) wait(0.1) sword.GripUp = Vector3.new(3, 1, 0) wait(0.1) sword.GripUp = Vector3.new(2, 1, 0) wait(0.1) sword.GripUp = Vector3.new(1, 1, 0) wait(0.1) sword.GripUp = Vector3.new(0, 1, 0) end
sword.Activated:connect(Slash)
sword.Part1.Touched:connect(function(hit) if slash == true then slash = false if hit.ClassName == "Part" and hit.Name ~= "Handle" and hit.Parent.Humanoid then hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - sword.Damage.Value wait(0.4) slash = true end end end)
sword.Part4.Touched:connect(function(hit) if slash == true then slash = false if hit.ClassName == "Part" and hit.Name ~= "Handle" and hit.Parent.Humanoid then hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - sword.Damage.Value wait(0.4) slash = true end end end)
Didn't work, got this output
20:52:58.070 - Humanoid is not a valid member of Workspace |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2015 07:56 PM |
| Can't just post a script and say help... especially on the wrong forum...... What's the problem with it? |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2015 07:57 PM |
| reread the post and reread scripters forum definition. |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2015 08:00 PM |
| Post it on Scripters, hence the name. |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2015 08:14 PM |
ROBLOX Forum » Game Creation and Development Home Search MyForums Game Creation and Development Threads Posts Last Post Game Marketing This is where you show off your awesome creations, talk about how to advertise your game or share your marketing and sale tactics. 3,991 22,642 06:08 PM Cheeso135 Game Design This is the forum to get help, talk about future ROBLOX game ideas, or gather an awesome building team. 44,718 261,580 06:11 PM Bubu2319 Scripters This is the place for discussion about scripting. Anything about scripting that is not a help request or topic belongs here. 61,258 821,910 06:08 PM oscar9999991 |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2015 08:14 PM |
"Scripters This is the place for discussion about scripting. Anything about scripting that is not a help request or topic belongs here." |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Jan 2015 08:18 PM |
| Don't beg for help. Ask what's the best way to have this script coded. Boom. |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2015 08:21 PM |
go learn what bumping is k? oh nevermind you didn't go read the definition of scripters either it means get it to the top of the forum then people will notice it more |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Jan 2015 08:33 PM |
| Actually I'm pretty sure I know what it means, I have a total of 60k+ posts that mostly came from Script helper and Build helper. Don't try to undermine me. |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2015 08:34 PM |
| Also, if you're scripting is apparently 8/10 then why can't you figure out such a simple script, huh? |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2015 08:41 PM |
TrustMeImRussian is either a troll or just hasn't seen the post by a moderator which said which forums were going to be merged into what.
Scripting Helpers and Building Helpers got merged into Game Design.
Don't mislead people. |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Jan 2015 09:00 PM |
| if this is such a simple script then fix it. |
|
|
| Report Abuse |
|
|