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 » Game Design
Home Search
 

Re: Script does not work, please help

Previous Thread :: Next Thread 
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
25 Jan 2015 06:42 PM
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 0 to several times
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
25 Jan 2015 06:48 PM
bump
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
25 Jan 2015 07:30 PM
bump
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
25 Jan 2015 07:55 PM
bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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