Need help with bots downing

hello, im developing a game with downing system, in which the player is knocked down instead of dying. same as special fake-player bots, they also downing instead of death

problem: downed animations does not plays and proximity prompt to revive bot doesnot shows too, however everything works fine with players.

code:

local ch = script.Parent.Parent
local hum = ch.Humanoid
hum:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
local d = false
local anims = script.Parent.anims
local downed = hum:WaitForChild("Animator"):LoadAnimation(anims.fell)
local idled = hum:WaitForChild("Animator"):LoadAnimation(anims.idle)
local rs = game.ReplicatedStorage

local function setupInstances()
	local pp = Instance.new("ProximityPrompt")
	pp.HoldDuration = 5
	pp.Enabled = false
	pp.ActionText = "REVIVE"
	pp.Parent = hum.RootPart
	pp.Name = "revive_prompt"

	local hl = Instance.new("Highlight")
	hl.Parent = ch
	hl.Adornee = ch
	hl.OutlineColor = Color3.fromRGB(255,255,255)
	hl.FillTransparency = 1
	hl.FillColor = Color3.fromRGB(255,255,255)
	hl.Enabled = false
	hl.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop

	return pp, hl
end

local prompt, highlight = setupInstances()

local function ableToRevive()
	prompt.Enabled = true
	highlight.Enabled = true
end

function revived()
	hum.RootPart.Anchored = false
	prompt.Enabled = false
	highlight.Enabled = false
	idled:Stop()
	downed:Stop()
	hum.Health = hum.MaxHealth
	d = false
	ch.default_highlight.Enabled = true
end

function DOWNED()
	if d then return end
	d = true
	print("DOWNED!")
	ch.default_highlight.Enabled = false
	hum.RootPart.Anchored = true
	script.Parent["headshot-pitched"]:Play()
	downed:Play()
	task.wait(1)
	idled:Play()
	ableToRevive()
	print("able to revive")
end

hum:GetPropertyChangedSignal("Health"):Connect(function()
	if hum.Health <= 0 then
		DOWNED()
	end
end)

video:

example of PLAYER downing:

1 Like

reason was in bot rigtype, animations was for r6, while bot is r15

There are tools that allow you to convert animations between rig type, consider looking at this one: 6to15: R6 to R15 Animation Converter Plugin

2 Likes

i already have this type of plugin, but thank you anyway

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.