I have made topics on how to insert this or that in tables here is one insert Name = Value
in tables but for me it’s complicated accessing through values or dictionary them has no purpose and one more thing the things I pass literally exists but the module doesn’t say it exists though
Output
Players.FerbZides.PlayerScripts.Aero.Controllers.MeleeWeaponSystemClient:38: invalid argument #3 (string expected, got nil) - Client - MeleeWeaponSystemClient:38
15:45:53.378 Stack Begin - Studio
15:45:53.378 Script 'Players.FerbZides.PlayerScripts.Aero.Controllers.MeleeWeaponSystemClient', Line 38 - function ChangeAnimation - Studio - MeleeWeaponSystemClient:38
15:45:53.380 Script 'Players.FerbZides.PlayerScripts.Aero.Controllers.MeleeWeaponSystemClient', Line 60 - Studio - MeleeWeaponSystemClient:60
15:45:53.380 Script 'ReplicatedStorage.Aero.Shared.Signal', Line 121 - Studio - Signal:121
15:45:53.380 Stack End - Studio
15:45:53.690 working - Client - MeleeWeaponSystemClient:51
Code
-- Melee Weapon System Client
-- Username
-- December 16, 2020
local MeleeWeaponSystemClient = {}
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(5, Enum.EasingStyle.Quad) -- 1 is time
function MeleeWeaponSystemClient:ChangeAnimation(Player, Table)
-- Table Format
--[[
Animations = {
Hold = "Blah Blah"
}
]]
local Character = Player.Character
local Humanoid = Character.Humanoid
-- >>: Get the following Things on the Table {"Hold", "Jump", "Run", "Walk"}
local animateScript = Character.Animate
-- Animation Variables
local WalkAnimationId = Table["Walk"]
local RunAnimationId = Table["Run"]
local IdleAnimationId = Table["Hold"]
local JumpAnimationId = Table["Jump"]
-- >>: Stop the Current Playing Animations from the Humanoid and play yours or ours
for _, PlayingAnimations in pairs(Humanoid:GetPlayingAnimationTracks()) do
PlayingAnimations:Stop()
end
animateScript.run.RunAnim.AnimationId = RunAnimationId -- Run
animateScript.walk.WalkAnim.AnimationId = WalkAnimationId -- Walk
animateScript.jump.JumpAnim.AnimationId = JumpAnimationId -- Jump
animateScript.idle.Animation1.AnimationId = IdleAnimationId -- Idle (Variation 1)
animateScript.idle.Animation2.AnimationId = IdleAnimationId -- Idle (Variation 2)
end
function MeleeWeaponSystemClient:Start()
local Player = game.Players.LocalPlayer
local MeleeWeaponSystem = self.Services.MeleeWeaponSystem
-- worst problem ever
MeleeWeaponSystem.PlayAnimation:Connect(function(Condition, AnimationsFolder)
print("working")
if Condition == true then
local ThisTable = {}
-- Play Animations
for AnimationName, AnimationObject in pairs(AnimationsFolder:GetChildren()) do
local ObjectName = AnimationName
ThisTable[ObjectName] = AnimationObject.AnimationId
MeleeWeaponSystemClient:ChangeAnimation(Player, ThisTable)
end
elseif Condition == false then
local ThisTable = {}
-- Play Animations
for AnimationName, AnimationObject in pairs(AnimationsFolder:GetChildren()) do
local ObjectName = AnimationName
table.insert(ThisTable, ObjectName)
ThisTable[ObjectName] = AnimationObject.AnimationId
MeleeWeaponSystemClient:ChangeAnimation(Player, ThisTable)
end
end
end)
MeleeWeaponSystem.ShowUI:Connect(function()
local UIObject = MeleeWeaponSystem.DamageUI
local ClonedDamagedUI = UIObject:Clone()
ClonedDamagedUI.Parent = HitPart
ClonedDamagedUI.Adornee = HitPart
local DamageText = ClonedDamagedUI.DamageText
DamageText.Text = AbbreviationModule:Abbreviate(CurrentDamage)
-- here is where you fade the text out.
local UITween = TweenService:Create(DamageText, tweenInfo, {TextTransparency = 1; TextStrokeTransparency = 1;})
UITween:Play()
UITween.Completed:wait()
ClonedDamagedUI:Destroy()
end)
end
function MeleeWeaponSystemClient:Init()
end
return MeleeWeaponSystemClient
been debugging these for literally minutes now and none of the solutions worked though