#Help me PLS
1 messages · Page 1 of 1 (latest)
ou
if PlayerCombos[Players] > 4 then
humanoid:Move(humanoid.Parent.HumanoidRootPart.Position)
humanoid.WalkSpeed = 0 -- Congela el movimiento
humanoid.JumpHeight = 0 -- Evita el salto
CanAttack[player] = false
task.wait(Cooldowntime)
humanoid.WalkSpeed = 16
humanoid.JumpHeight = 7
** You are now Level 1! **
@split thistle
srry
the script is a combat handler
when you do a click then get a animation
its a battleground btw
when you go to 4 animation you have to get cooldown and cant move
but i cant get the last
Show the whole script and format it
sure
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local ClickAttack = ReplicatedStorage.Events:WaitForChild("ClickAttack")
local AttackAnimations = ReplicatedStorage:WaitForChild("AttackAnimations"):GetChildren()
local Cooldowntime = 2
local COOLDOWN_BETWEEN_ATTACKS = 0.5
local AttackCooldown = {}
local PlayerCombos = {}
local ActiveAnimations = {}
local CanAttack = {}
ClickAttack.OnServerEvent:Connect(function(player)
local Personaje = Player.Character
if not Personaje then return end
local humanoid = Personaje:FindFirstChild("Humanoid")
local animator = humanoid and humanoid:FindFirstChild("Animator")
if not humanoid or not animator then return end
if (AttackCooldown[player] and tick() < AttackCooldown[player]) or CanAttack[player] == false then
return
end
if not PlayerCombos[player] then
PlayerCombos[player] = 1
end
if ActiveAnimations[player] then
ActiveAnimations[player]:Stop()
end
local animationIndex = PlayerCombos[player]
local animation = AttackAnimations[animationIndex]
if not animation then return end
PlayerCombos[Players] = PlayerCombos[player] + 1
if PlayerCombos[Players] > 4 then
humanoid:Move(humanoid.Parent.HumanoidRootPart.Position)
humanoid.WalkSpeed = 0
humanoid.JumpHeight = 0
CanAttack[player] = false
task.wait(Cooldowntime)
humanoid.WalkSpeed = 16
humanoid.JumpHeight = 7
PlayerCombos[player] = 1
ActiveAnimations[player] = nil
CanAttack[player] = true
else
end
end)
that is the whole script
Do you notice anything strange?
@split thistle
Put ``` under it
At the end
I'm reading
Wait can you explain the error again
sure
** You are now Level 2! **
okay
I didn't rlly get it 😅
I'm creating a battleground and I want that when my character reaches the 4th animation (the one that would hit you with the ragdoll) he freezes.
you're comparing tick agains the player
Ok
Lemme read through the script
@split thistle He set canattack to true at the end
the condition u want is canattack == falsee
help me pls i doing this game for 3 months and i have this problem whole time
the scripts
so what i would change?
canattack[player] is litterally nil
is it even playing?
yes the animations play but the only thing doesnt work is the cooldown
you can keep spamming it?
is the unique thing is dont funcion
ready
Also
You should handle animations and hitbox on client
Combo can be server
But
If anything, anims should at least be from client
Especially since its just an m1
You can still play victim hit on server
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local ClickAttack = ReplicatedStorage.Events:WaitForChild("ClickAttack")
local AttackAnimations = ReplicatedStorage:WaitForChild("AttackAnimations"):GetChildren()
local Cooldowntime = 2
local COOLDOWN_BETWEEN_ATTACKS = 0.5
local AttackCooldown = {}
local PlayerCombos = {}
local ActiveAnimations = {}
local CanAttack = {}
ClickAttack.OnServerEvent:Connect(function(player)
local Personaje = Player.Character
if not Personaje then return end
local humanoid = Personaje:FindFirstChild("Humanoid")
local animator = humanoid and humanoid:FindFirstChild("Animator")
if not humanoid or not animator then return end
if CanAttack[player] == false then
return
end
if not PlayerCombos[player] then
PlayerCombos[player] = 1
end
if ActiveAnimations[player] then
ActiveAnimations[player]:Stop()
end
local animationIndex = PlayerCombos[player]
local animation = AttackAnimations[animationIndex]
if not animation then return end
PlayerCombos[Players] = PlayerCombos[player] + 1
if PlayerCombos[Players] > 4 then
humanoid:Move(humanoid.Parent.HumanoidRootPart.Position)
humanoid.WalkSpeed = 0
humanoid.JumpHeight = 0
CanAttack[player] = true
task.wait(Cooldowntime)
humanoid.WalkSpeed = 16
humanoid.JumpHeight = 7
PlayerCombos[player] = 1
ActiveAnimations[player] = nil
CanAttack[player] = false
else
end
end)
try that
wait.
I feel like renaming the table to OnCooldown
i know why it
no no
Thanks, sorry if they are errors from the beginning, it's just that I don't have much experience with scripts.
wait..
@vagrant pagoda Are u trying to do hit combo cooldown
Looking at it
yes
Like the last m1
when the character got 4 anim get cooldown
so player
cant move
cant jump
cant do M1
cant do anything
try the one i gave u
okayy
i will tryy
mmmm
nop
it doesnt funcion
Why is it if combo > 4
where
if PlayerCombos[Players] > 4 then
that?
Inside here
?
Its not yours?

Yeah I figured
** You are now Level 3! **
No worries its alright to use AI sometimes as long as the whole thing isn't ai

Lemme try fix it on pc
Thank you for understanding me
sure sure
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local ClickAttack = ReplicatedStorage.Events:WaitForChild("ClickAttack")
local AttackAnimations = ReplicatedStorage:WaitForChild("AttackAnimations"):GetChildren()
local Cooldowntime = 2
local COOLDOWN_BETWEEN_ATTACKS = 0.5
local AttackCooldown = {}
local PlayerCombos = {}
local ActiveAnimations = {}
local M1Cooldown = {}
ClickAttack.OnServerEvent:Connect(function(player)
local Personaje = Player.Character
if not Personaje then return end
local humanoid = Personaje:FindFirstChild("Humanoid")
local animator = humanoid and humanoid:FindFirstChild("Animator")
if not humanoid or not animator then return end
if (AttackCooldown[player] and tick() < AttackCooldown[player]) or M1Cooldown[player] then
return
end
if not PlayerCombos[player] then
PlayerCombos[player] = 1
end
if ActiveAnimations[player] then
ActiveAnimations[player]:Stop()
end
local animationIndex = PlayerCombos[player]
local animation = AttackAnimations[animationIndex]
if not animation then return end
PlayerCombos[player] = PlayerCombos[player] + 1
if PlayerCombos[player] >= 4 then
humanoid:Move(humanoid.Parent.HumanoidRootPart.Position)
humanoid.WalkSpeed = 0
humanoid.JumpHeight = 0
M1Cooldown[player] = true
task.wait(Cooldowntime)
humanoid.WalkSpeed = 16
humanoid.JumpHeight = 7
PlayerCombos[player] = 1
ActiveAnimations[player] = nil
M1Cooldown[player] = nil
else
end
end)
@vagrant pagoda
trythis
okay
if theres any console errors lmk
sure sure
thx for help again and sorry
@split thistle
isnt working
console "error" is this
who i got to put?
the line code is this
local Personaje = Player.Character
make player lowercase
In here
Yeah
THE COOLDOWN IS RIGHT BUT NO SO RIGHT
when i do a click the cooldown works buuuutt
i want when i do the 4 click
the cooldown get true
ah and i still cant punch
Oh
okay let me try do something
Alr
okay
My scripting soul was on fire, but not hot enough to fix the code.
@pearl seal
can you help?
@split thistle
should i try put the
PlayerCombos[player] = 4?
No
okay
** You are now Level 4! **
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local ClickAttack = ReplicatedStorage.Events:WaitForChild("ClickAttack")
local AttackAnimations = ReplicatedStorage:WaitForChild("AttackAnimations"):GetChildren()
local Cooldowntime = 2
local COOLDOWN_BETWEEN_ATTACKS = 0.5
local AttackCooldown = {}
local PlayerCombos = {}
local ActiveAnimations = {}
local M1Cooldown = {}
ClickAttack.OnServerEvent:Connect(function(player)
local Personaje = Player.Character
if not Personaje then return end
local humanoid = Personaje:FindFirstChild("Humanoid")
local animator = humanoid and humanoid:FindFirstChild("Animator")
if not humanoid or not animator then return end
if M1Cooldown[player] then
return
end
if not PlayerCombos[player] then
PlayerCombos[player] = 1
end
if ActiveAnimations[player] then
ActiveAnimations[player]:Stop()
end
local animationIndex = PlayerCombos[player]
local animation = AttackAnimations[animationIndex]
if not animation then return end
PlayerCombos[player] = PlayerCombos[player] + 1
if PlayerCombos[player] >= 4 then
humanoid:Move(humanoid.Parent.HumanoidRootPart.Position)
humanoid.WalkSpeed = 0
humanoid.JumpHeight = 0
M1Cooldown[player] = true
task.wait(Cooldowntime)
humanoid.WalkSpeed = 16
humanoid.JumpHeight = 7
PlayerCombos[player] = 1
ActiveAnimations[player] = nil
M1Cooldown[player] = nil
else
end
end)
Try this ig
okay i will try
thx for help
we go back to the start point
the cooldown got false lol
@split thistle do you want to record what my Character do on the game? so you can see what is grong with the code
Yes
Here
Yeah
But
I cant watch rn
I gotta afk
I'll be back later
okeee
@frigid isle (sorry for tag but i see you have a rarelly icon scripter) can you help me?
YEY
thank you
ok mi issue is
i am creating a battleground, but i have a several issue, when i do a click mi cooldown get true and the animations still can play
@frigid isle
You arent a native english speaker so It may be a little hard to communicate
yea thats right
thats is not me but btw
i understand english very well dont problem with communication
ok
so
so what are you trying to do
I was a bit confused here
when my player do the 4 animation get cooldown
the cooldown is right but i can still do the animation
In this code I see nothing about playing an animation
are we looking at the right code right now
yea that is the right code
I dont see you ever playing an animation
so i should agree a animation play?
you are saying the player can still do the animation even when the cooldown is on
yea
but in this piece of code, you have nothing that is related to playing the animation
which is why im confused ur having a problem
local animationIndex = PlayerCombos[player]
local animation = AttackAnimations[animationIndex]
if not animation then return end
is this your full code?
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local ClickAttack = ReplicatedStorage.Events:WaitForChild("ClickAttack")
local AttackAnimations = ReplicatedStorage:WaitForChild("AttackAnimations"):GetChildren()
local Cooldowntime = 1.5
local COOLDOWN_BETWEEN_ATTACKS = 0.5
local AttackCooldown = {}
local PlayerCombos = {}
local ActiveAnimations = {}
local M1Cooldown = {}
ClickAttack.OnServerEvent:Connect(function(player)
local Personaje = player.Character
if not Personaje then return end
local humanoid = Personaje:FindFirstChild("Humanoid")
local animator = humanoid and humanoid:FindFirstChild("Animator")
if not humanoid or not animator then return end
if M1Cooldown[player] then
return
end
if not PlayerCombos[player] then
PlayerCombos[player] = 1
end
if ActiveAnimations[player] then
ActiveAnimations[player]:Stop()
end
local animationIndex = PlayerCombos[player]
local animation = AttackAnimations[animationIndex]
if not animation then return end
PlayerCombos[player] = PlayerCombos[player] + 1
if PlayerCombos[player] >= 4 then
humanoid:Move(humanoid.Parent.HumanoidRootPart.Position)
humanoid.WalkSpeed = 0
humanoid.JumpHeight = 0
M1Cooldown[player] = true
task.wait(Cooldowntime)
humanoid.WalkSpeed = 16
humanoid.JumpHeight = 7
PlayerCombos[player] = 1
ActiveAnimations[player] = nil
M1Cooldown[player] = nil
else
end
end)
o
srry i dont get it
@frigid isle
thats my full code
can you tell me how to repair or something?
:,c
** You are now Level 5! **