#Attack animations
30 messages · Page 1 of 1 (latest)
Theres 2 scripts
do you want to see them both?
Local and Server? But yeah sure.
Yes but i also used 2 different scripts
One had a local and server
another one was inside the sword
Ill show you
okay heres the first script
the one with 2 attack animations
--CONFIGURATION
local Turn = 1
local Damage = 20
local Cooldown = 0.03
--END
script.Parent.Activated:Connect(function()
if script.Parent.Cooldown.Value == false then
script.Parent.Cooldown.Value = true
script.Parent.CanDamage.Value = true
local Humanoid = script.Parent.Parent.Humanoid
local Anim1 = Humanoid:LoadAnimation(script.Parent.Attack1)
local Anim2 = Humanoid:LoadAnimation(script.Parent.Attack2)
if Turn == 1 then
Anim1:Play()
Turn = 2
Anim1.Stopped:wait(Cooldown)
script.Parent.CanDamage.Value = false
script.Parent.Cooldown.Value = false
elseif Turn == 2 then
Anim2:Play()
Turn = 1
Anim2.Stopped:Wait(Cooldown)
script.Parent.CanDamage.Value = false
script.Parent.Cooldown.Value = false
end
else
return
end
end)
script.Parent.Handle.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") then
local Humanoid = Hit.Parent.Humanoid
if script.Parent.CanDamage.Value == true then
Humanoid:TakeDamage(Damage)
script.Parent.CanDamage.Value = false
else
return
end
else
return
end
end)
there is no problem with this one
but I need more swings than 2
and then for the second one
this is the local script
local RS = game:GetService("ReplicatedStorage")
local Tool = script.Parent
Tool.Activated:Connect(function()
RS.Events.Swing:FireServer(script.Parent)
end)
this is the server script
this one just doesnt even work
In this script, you need to keep on the IFs go higher and higher
if Turn == 3 then
--insert scrit stuff
end
Like here, and also make it so it's possible to have it go up to 5
and in each one change the line
in Turn 2 to you need to make it 3, in turn 3 you need to make it 4, and so on.
At turn 5 you need to change Turn to 1 so it's getting a reset just like right now in turn 2
@limpid glade
im not following
Do you have any scripting knowgledge?
None
You should get even the knowgledge about variables and such, because I'm not really about writing this for you.
I think you misunderstood me
** You are now Level 2! **
Im asking how to add more swings to the script
Well that's what I told you