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

Why isn't the script creating a new object?

Asked by 10 years ago
function abilities(key)
if key == "q" then
local bodySpin = Instance.new("BodyAngularVelocity")
bodySpin.P = 200000
bodySpin.angularvelocity = Vector3.new(0,15,0)
bodySpin.maxTorque = Vector3.new(bodySpin.P,bodySpin.P,bodySpin.P)
bodySpin.Parent = torso

wait(5)

end
end
mouse.KeyDown:connect(abilities)

Why isn't this creeating a new BodyAngularVelocity?

1 answer

Log in to vote
1
Answered by
jobro13 980 Moderation Voter
10 years ago

My guess is that you did not define "mouse".

Add this to your script: (before the last line with mouse.KeyDown:connect)

local mouse = game.Players.LocalPlayer:GetMouse()

Assuming it is a LocalScript.

0
Oh i didn't paste that in, but I defined all the variables used here. The script runs with no errors, but the only action is the print statement VongolaXII 15 — 10y
Ad

Answer this question