Gore System Error

Hello, I was doing a gore system and I thought it was finished, but it had two errors
One serious and one not so serious.

The first problem was in Melee_Client
this is the error
Captura de pantalla 2023-05-26 200146

The other one was in Utilities
This is the error
Captura de pantalla 2023-05-26 193548

Unfortunately I can’t send the scripts because for some reason I can’t close the lua code box, i just can send one per topic i dont really know why

And for that reason I am going to send the most important one, which is the Utilities one, since without the animations the system does not work.

Thank you.

local anims = {}

function module.Weld(Part0, Part1, Parent, Name, Bool)
	local Weld
	if Bool then
		Weld = Instance.new("WeldConstraint")
	else
		Weld = Instance.new("Weld")
	end
	Weld.Part0 = Part0
	Weld.Part1 = Part1
	Weld.Name = Name or Weld.Name
	Weld.Parent = Parent or Part0
end
function module.LoadAnimation(AnimationId: string, Object: Humanoid)
	local AnimationTrack = nil
	local Animation = Instance.new("Animation")
	Animation.AnimationId = AnimationId
	Animation = Object:LoadAnimation(Animation)
	return Animation
end
function module.PlayAnimation(Animation: AnimationTrack, Table: table)
	Animation:Play()
	Animation.Priority = Table.AnimationPriority
	Animation:AdjustSpeed(Table.AnimationSpeed)
	Animation.Looped = Table.Looped
	if not anims[Animation] then
		anims[Animation] = true
		for i,v in pairs(Table.AnimationEvents) do
			Animation:GetPropertyChangedSignal(v.AnimationEventName):Connect(function()
				v.Function()
			end)
		end
	end
end
function module.Random(A, B)
	return Random.new():NextNumber(A, B)
end
function module.ReturnRandom(Value: table)
	return Value[math.random(#Value)]
end
function module.ReturnChildren(Folder)
	return Folder:GetChildren()
end
function module.ReturnFolderChild(Folder)
	return module.ReturnRandom(module.ReturnChildren(Folder))
end
function module.PlaySound(SoundBase: Sound, Parent: BasePart?)
	local Sound = SoundBase:Clone()
	Sound.Parent = Parent
	Sound:Play()
	Sound.Ended:Connect(function()
		Sound:Destroy()
	end)
end

return module```
1 Like

The first one instead of blacklist you can use Exclude, they changed Whitelist and Blacklist to Include and Exclude.

You can’t do :LoadAnimation() on the Humanoid any more, you have to do it on the Animator. The Animator is a child of the Humanoid so you just have to wait for it to be added and do Animator:LoadAnimation().

2 Likes

Documentation:

local anims = {}

local module = {}

function module.Weld(Part0, Part1, Parent, Name, Bool)

local Weld

if Bool then

Weld = Instance.new("WeldConstraint")

else

Weld = Instance.new("Weld")

end

Weld.Part0 = Part0

Weld.Part1 = Part1

Weld.Name = Name or Weld.Name

Weld.Parent = Parent or Part0

end

function module.LoadAnimation(AnimationId: string, Object: Humanoid)

local AnimationTrack = nil

local Animation = Instance.new("Animation")

Animation.AnimationId = AnimationId

Animation = Object.Animator:LoadAnimation(Animation)

return Animation

end

function module.PlayAnimation(Animation: AnimationTrack, Table: table)

Animation:Play()

Animation.Priority = Table.AnimationPriority

Animation:AdjustSpeed(Table.AnimationSpeed)

Animation.Looped = Table.Looped

if not anims[Animation] then

anims[Animation] = true

for i,v in pairs(Table.AnimationEvents) do

Animation:GetPropertyChangedSignal(v.AnimationEventName):Connect(function()

v.Function()

end)

end

end

end

function module.Random(A, B)

return Random.new():NextNumber(A, B)

end

function module.ReturnRandom(Value: table)

return Value[math.random(#Value)]

end

function module.ReturnChildren(Folder)

return Folder:GetChildren()

end

function module.ReturnFolderChild(Folder)

return module.ReturnRandom(module.ReturnChildren(Folder))

end

function module.PlaySound(SoundBase: Sound, Parent: BasePart?)

local Sound = SoundBase:Clone()

Sound.Parent = Parent

Sound:Play()

Sound.Ended:Connect(function()

Sound:Destroy()

end)

end

return module

its like what @TaxFraudBruh said
I fired this when a player joins a game but i put wait(2) u could probably do less but

I alr fixed that, but now it only works once, i mean when you hit once it doesn’t hit again