Hey, I hate to keep on posting I posted the same topic on scriptinghelpers.org
and nobody could really help me. So heres my problem it tells me on script line 2 that Players.Kykysurvivin.Backpack.Sword.Animation:2: attempt to index nil with ‘Character’
I don’t know if this is something simple but I would Appreciate a little help! Thanks for your time
Here is the code:
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local SwordAnim = script.Parent:WaitForChild("SwordAnim")
local SwordTrack = Humanoid:LoadAnimation(SwordAnim)
script.Parent.Activated:Connect(function()
SwordTrack:Play(0)
end)
Hey so its not working and Im wondering if its because I have a sword server script check this out
local tool = script.Parent
local function onTouch(partOther)
local humanOther = partOther.parent:FindFirstChild("Humanoid")
if not humanOther then return end
if humanOther.Parent == tool then return end
humanOther:TakeDamage(20)
end
tool.Handle.Touched:Connect(onTouch)
The server script seems alright, it’s not interfering. What type of error you’re getting this time? Also could you send me a screenshot of your tool script hierarchy
Hey, I feel so dumb. Because I just realized that the reason its not working now and there is no errors is because the animation is in r15 and my game runs on r6. So sorry for wasting your time. Thanks for your help!
I believe using Humanoid instead of Animator won’t make the animation replicate to other clients, as again, is deprecated. But of course you can still use it