I’ma just explain this quick & simple, I am trying to achieve of allowing a Player to click the Torso of a Charater ( Including Non Player Characters ) so that their humanoidRootPart is locked onto the Player;s arms that clicked them. I’ve look through devforums and youtube & been trying to solve this for about a hour now. Here are my Scripts
local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local RemoteEvents = ReplicatedStorage:WaitForChild("RemoteEvents") local RE = RemoteEvents.Get_Player local Player = Players.LocalPlayer local PlrMouse = Player:GetMouse() local Target = PlrMouse.Target local HighestAncestor = Target PlrMouse.Button1Down:Connect(function() RE:FireServer(HighestAncestor) end)
Main Script ( Inside ServerScript Service )
GP.OnServerEvent:Connect(function(player, HighestAncestor) if HighestAncestor:FindFirstChild("Humanoid") then print("Character Detected") else print("Non Character") end end)
Whats going on is that I’m trying to print out if the character exists first by humanoid, i test the game, I click a characters torso to see if it can find a humanoid it prints “Non Character” it also says non character if i click baseplate but thats what its suppose to do. I need help on this.