Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why isn't the script creating a new object?

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

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.

1 comment

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

This discussion is preserved as it was. New answers, comments, and votes are closed.