--unbinding controls
game.Players.LocalPlayer:WaitForChild("Character").DescendantAdded:Connect(function(child)
if child.Name == "KnockBack" then
CAServ:UnbindAction("Left Punch")
CAServ:UnbindAction("Right Punch")
CAServ:UnbindAction("Kick")
end
end)
“Infinited yield possible on waitforchild(“character”)”
initially this doesnt seem to break anything
but then the script i put afterwards didnt work until i moved it before it, meaning it seems to break anything that comes after it?
or
something?
idek, but how can i get rid of this message?
local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
-- references player.Character but if it is nil, it waits for the character to be added and then returns it
char.DescendantAdded:Connect(function(child)
end)
“Character” is a property of player instances not a child, this property points to the player’s character model. To wait for its replication (existence), you can use the “.CharacterAdded” event.
local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()