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

Why doesn't this spawn a part?

Asked by
Mystdar 352 Moderation Voter
10 years ago

I am trying to make a part spawn when a player plays an animation, the animation plays, but that is all I get, nothing from the output either.


local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?id=178966770" local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() local animTrack = nil local Playername = Player.Name Mouse.KeyDown:connect(function(key) if key:lower() == "q" then local character = Player.Character animTrack = character:WaitForChild("Humanoid"):LoadAnimation(animation) animTrack:Play() animTrack.KeyframeReached:connect(function(keyframeName) -- New function if keyframeName == 2 then -- When it gets to the second key frame do local Javalin = game.Lighting.Javalin:Clone() Javalin.Parent = game.Workspace Weld = Instance.new("Weld") Weld.Parent = game.Workspace.Playername["Right Arm"] Weld.Part0 = game.Workspace.Playername["Right Arm"] Weld.Part1 = Javalin for i=1, 40 do Javalin.Mesh.Scale.x = Javalin.Mesh.Scale.x +0.5 wait(0.1) end end end) end end)
0
Is FilterningEnabled on? If so, you will have to make it use RemoteEvents/Functions to work properly in servers. Tkdriverx 514 — 10y
0
I have no idea what it is so I presume it is what it is set to as defult, but, what about the question? Mystdar 352 — 10y

Answer this question