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 4 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

01local chr = script.Parent.Parent.Parent.Parent.Character
02Animationplay = true
03scissorblade = chr["Blade"]
04dmg = scissorblade.dmg.Script
05dmg.Disabled = true
06button = script.Parent
07button.MouseButton1Down:Connect(function()
08    if Animationplay == true then
09        local attack = chr.Humanoid:LoadAnimation(script.Attack)
10        dmg.Disabled = false
11        attack:Play()
12        Animationplay = false
13        chr.Humanoid.WalkSpeed = 0
14        wait(.5)
15        dmg.Disabled = true
16        chr.Humanoid.WalkSpeed = 60
17        Animationplay = true
18    end
19end)

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 — 4y
0
scissorblade* SpiralRBX 224 — 4y
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 — 4y

Answer this question