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
The other one was in Utilities
This is the error
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```