--unbinding and rebinding melee moves with remote event (THE SCRIPT ABOVE ^^^ MAY BE REPLACED BY THIS IF I CARE ENOUGH)
game.ReplicatedStorage.abilityRemoteEvents.meleeDisabler.OnClientEvent:Connect(function(limit)
--unbings melee keybinds for a set amount of time
CAServ:UnbindAction("Left Punch")
CAServ:UnbindAction("Right Punch")
CAServ:UnbindAction("Kick")
--wait "limit", then rebind
wait(limit)
CAServ:BindAction("Left Punch", leftPunch, false, Enum.UserInputType.MouseButton1)
CAServ:BindAction("Right Punch", rightPunch, false, Enum.UserInputType.MouseButton2)
CAServ:BindAction("Kick", kick, false, Enum.KeyCode.E)
end)
server script
--fire remote event "meleeDisabler" to disable melee moves
game.ReplicatedStorage.abilityRemoteEvents.meleeDisabler:FireClient(plr, 12)
yeah it just doesnt work (it doesnt unbind the functions for the melee stuff, im still able to use thme)
no errors, nothing
yes, in the full script the keybinds are bound beforehand, so it shouldnt be because i unbound them before i rebind them
EDIT: i put prints in the thing, and it seems it isnt printing? so its as if the remote event isnt even being fired? but how does that make sense? its fired before everything else in the script, and everything else afterwards runs fine? and theres no errors?
--unbinding and rebinding melee moves with remote event (THE SCRIPT ABOVE ^^^ MAY BE REPLACED BY THIS IF I CARE ENOUGH)
local function Fired()
--unbings melee keybinds for a set amount of time
CAServ:UnbindAction("Left Punch")
CAServ:UnbindAction("Right Punch")
CAServ:UnbindAction("Kick")
--wait "limit", then rebind
wait(limit)
CAServ:BindAction("Left Punch", leftPunch, false, Enum.UserInputType.MouseButton1)
CAServ:BindAction("Right Punch", rightPunch, false, Enum.UserInputType.MouseButton2)
CAServ:BindAction("Kick", kick, false, Enum.KeyCode.E)
end)
end
game.ReplicatedStorage.abilityRemoteEvents.meleeDisabler.OnClientEvent = function(Fired)
Sometimes it’s the simple things like I just did that don’t make script works.
Try this and if it doesnt work I have one more idea
--unbinding and rebinding melee moves with remote event (THE SCRIPT ABOVE ^^^ MAY BE REPLACED BY THIS IF I CARE ENOUGH)
function Fired()
--unbings melee keybinds for a set amount of time
CAServ:UnbindAction("Left Punch")
CAServ:UnbindAction("Right Punch")
CAServ:UnbindAction("Kick")
--wait "limit", then rebind
wait(limit)
CAServ:BindAction("Left Punch", leftPunch, false, Enum.UserInputType.MouseButton1)
CAServ:BindAction("Right Punch", rightPunch, false, Enum.UserInputType.MouseButton2)
CAServ:BindAction("Kick", kick, false, Enum.KeyCode.E)
end)
end
game.ReplicatedStorage.abilityRemoteEvents.meleeDisabler.OnClientEvent = function(Fired,limit)
Print the Value you sent from the server and print the value from the client, it maybe just because the client and the server has a different value. that’s why it does not gives error.
turns out it was because it was after a line of code that ended up giving a “infinite yield possible” warning
i moved it before that and it works
now im trying to get rid of the whole infinite yield possible warning so it doesnt mess things up somehow in the future like it did here