#combat scripting not working
1 messages · Page 1 of 1 (latest)
uno minute
** You are now Level 3! **
whole script?
well whatever is wrong
heres part of it m1 is supposed to do the punches but it dont work
local function getAnimation(char, keyDown, currentCharacter)
local values = char:WaitForChild("Values")
local hum = char:WaitForChild("Humanoid")
local values = char:WaitForChild("Values")
local combo = values:FindFirstChild("Combo")
local Type = "M1"
local animation = assets.Animations[currentCharacter].Combat["Punch"..combo.Value]
if combo.Value >= 4 then
if hum:GetState() == Enum.HumanoidStateType.Freefall or hum.FloorMaterial == Enum.Material.Air then
animation = assets.Animations[currentCharacter].Combat.Downslam
Type = "Downslam"
elseif keyDown then
animation = assets.Animations[currentCharacter].Combat.Uppercut
Type = "Uppercut"
end
end
return Type, animation
end
so it dosent play the animations?
no
ye
add print statements to see if your script is working
for example print("clicked")
in a diff new script?
`local function getAnimation(char, keyDown, currentCharacter)
local values = char:WaitForChild("Values")
local hum = char:WaitForChild("Humanoid")
local combo = values:FindFirstChild("Combo")
print("combo value: " .. combo.Value) -- check combo value
local Type = "M1"
local animation = assets.Animations[currentCharacter].Combat["Punch"..combo.Value]
if combo.Value >= 4 then
print("combo value is >= 4") -- combo is 4 or more
if hum:GetState() == Enum.HumanoidStateType.Freefall or hum.FloorMaterial == Enum.Material.Air then
print("in freefall or air, switching to downslam") -- player in freefall or air, switch to downslam
animation = assets.Animations[currentCharacter].Combat.Downslam
Type = "Downslam"
elseif keyDown then
print("uppercut triggered") -- uppercut condition triggered
animation = assets.Animations[currentCharacter].Combat.Uppercut
Type = "Uppercut"
end
end
print("keyDown: " .. tostring(keyDown)) -- check if keyDown is true
print("final animation: " .. animation) -- final animation selected
return Type, animation
end
`
when you call getAnimation it will print whether keyDown is true (when you press M1) or false (if not)
it will also continue to print the rest of the information like the combo value the final selected animation and any other important info
lemme try
it dont work my gng im sorry 😭
what part dosent work
still the punch doesnt work