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

Script doesn't see a model in my Player. Can someone help me?

Asked by 3 years ago

Hello. I am making a script that plays an animation (sword is auto equipped without a tool.) Apparently, the script says there is no model called "Blade" in workspace.luvumilo (luvumilo is my username.) Here is the code

local chr = script.Parent.Parent.Parent.Parent.Character
Animationplay = true
scissorblade = chr["Blade"]
dmg = scissorblade.dmg.Script
dmg.Disabled = true
button = script.Parent
button.MouseButton1Down:Connect(function()
    if Animationplay == true then
        local attack = chr.Humanoid:LoadAnimation(script.Attack)
        dmg.Disabled = false
        attack:Play()
        Animationplay = false
        chr.Humanoid.WalkSpeed = 0
        wait(.5)
        dmg.Disabled = true
        chr.Humanoid.WalkSpeed = 60
        Animationplay = true
    end
end)

Output says that on line 3, "Blade is not a valid member of Model "Workspace.luvumilo". I've tried changing the code over and over again, but nothing has worked. If anybody knows how to fix this problem, please answer or comment. Extra info: Script is in a TextButton inside of a ScreenGui inside of StarterGui (which goes inside the LocalPlayer when server is launched)

0
Wouldn't hurt to do "scissorblad = chr:WaitForChild("Blade") SpiralRBX 224 — 3y
0
scissorblade* SpiralRBX 224 — 3y
0
Maybe you are equipping the blade on Client Side only? Server Script won't see it if it's been put by Local Script. personal_ly 151 — 3y

Answer this question