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

How do you find a players character?

Asked by 8 years ago
tool = script.Parent
handle = tool.Handle
Player = script.Parent.Parent
rightshoulder = Player.Character.Torso
tool.Equipped:connect(function()

end)
tool.Activated:connect(function()
    rightshoulder.C0 = rightshoulder.C0 *CFrame.Angles(0, 0, 0.16)
end)

Tried to make it when you clicked, you would like slay with your sword. However, I'm having trouble finding my character torso!

Keep in mind this is in a tool! Of course, in local scripts im able to easily find them but i dont get it when you use a tool

any soloutions would be appreciated!

2 answers

Log in to vote
0
Answered by 8 years ago

The tool (when equipped) is placed inside the character. So just do:

local tool = script.Parent
local Char = tool.Parent
local Torso = Char:WaitForChild("Torso")
Ad
Log in to vote
0
Answered by 8 years ago

How to find the character:

local char = script.Parent.Parent

How to find the player:

local plr = game.Players:FindFirstChild(script.Parent.Parent.Name)

Answer this question