Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Infinite yield possible on 'Players.LiamQ926.Backpack:WaitForChild("Sword") help?

Asked by 1 year ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.
--Varables
local Form1 = script:WaitForChild("FirstForm")
local equipped = false
local UIS = game:GetService("UserInputService")
local tool = game.Players.LocalPlayer:WaitForChild("Backpack")
local Sword = tool:WaitForChild("Sword")

--Animate
Sword.Equipped:Connect(function()
    equipped = true
end)

Sword.Unequipped:Connect(function()
    equipped = false
end)

UIS.InputBegan:Connect(function(Input, isChatting)
    if isChatting then return end
    if Input.KeyCode == Enum.KeyCode.Q and equipped == true then

        local Humanoid = Sword.Parent:WaitForChild("Humanoid")
        local AnimTrack = Humanoid:LoadAnimation(Form1)

        AnimTrack:Play()
    end
end
1
Next time, please provide more explanation. We're not google, we're not akinator, we're not bots: we won't solve your problem easily without more information. T3_MasterGamer 2189 — 1y
0
I don't see any part of the code that puts the sword in the backpack. If another script is supposed to do that, please share that one as well. Otherwise, there is your problem. AronYstad 101 — 1y
0
The Sword is located in starter pack LiamQ926 7 — 1y

Answer this question