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

why is my code not putting the instance of bodyangularvelocity in my characters righthand?

Asked by 5 years ago
Edited 5 years ago
01local players = game:GetService("Players")
02local tool = script.Parent
03 
04 
05game.Players.PlayerAdded:Connect(function(player)
06player.CharacterAdded:Connect(function(character)
07    local b = Instance.new("BodyAngularVelocity",character["RightHand"])
08 
09 
10end)
11 
12end)
13 
14tool.Equipped:Connect(function(mouse)
15 
View all 22 lines...

1 answer

Log in to vote
0
Answered by
Unhumanly 152
5 years ago

Comparing the question to the code you have, I can see that you are putting a BodyAngularVelocity inside of the right hand of players that are joining the game, not your right hand.

01local tool = script.Parent
02local player = tool.Parent
03 
04player.CharacterAdded:Connect(function(character)
05    local b = Instance.new("BodyAngularVelocity",character.RightHand)
06 
07end)
08 
09tool.Equipped:Connect(function(mouse)
10 
11end)
12 
13 
14tool.Activated:Connect(function()
15 
16 
17end)

Also, you don't need to do this:

1character["RightHand"]

Because there aren't any spaces in the name of the instance.

Ad

Answer this question