ok so i have this attribute that works like a true or false, im making a pvp game, its calls “attacking”, so, this attribute allows the player to slowdown the walkspeed, on a localscript when is true.
and when is fired a function from the server, when trying to combo, this attribute goes like crazy when is soppoudly to be on true goes false bc the function before i did (an attack) is done and turns the attribute on false.
so, i just want to maintine the attribute on true,and when the player is done attaking, goes false.
a very good example is tsb.
i cant show the script bc is a bunch of scripts, but do the same method to turn on the attribute, like this:
function attack ()
--something
char:SetAttribute("Attacking", true)
task.wait(x)
--attacking shinanigans
task.wait(x)
char:SetAttribute("Attacking", false)
--something
end
should i use something rather then wait?, cuz is a bunch of different scripts. but using the same method to turn on this attribute, keep that on mind, pls help i been dealing this for years by now, i just want to make a good combat combo experience like my favorites games, like tsb, black magic 2, damn even yba, or abd, and others.
You should use numbers instead. Everytime you do an attack, instead of setting it to true, add 1. This way everytime you attack the counter goes up 1 and can never reach 0 until the last attack stops. And instead of checking if attacking is true, check if the value is higher than 0.
hi guys, i managed to do a method, not the best, but, very effective, by searching and looking i made this:
function module.attack_test(player, timee)
local value = Instance.new("NumberValue", player)
value.Name = "Attack_Test"
value.Value = timee
game:GetService("Debris"):AddItem(value, timee)
end
made this function that basicly just made makes a number value on the character and then i check on client checks if there any child added or removed with the name and the IsA, and the server do the check and bla bla, very simple, but effectible