local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Mouse = Player:GetMouse()
Mouse.Button1Down:Connect(function()
if Mouse.Target.Parent:FindFirstChild("Humanoid")then
print("Mouse.Target ==" ..Mouse.Target.Name)
local Distance = (Character.HumanoidRootPart.Position - Mouse.Target.Parent.HumanoidRootPart.Position).magnitude
if Distance <= 20 then
print(Distance)
local OtherPlr = Mouse.Target.Parent
game.ReplicatedStorage.Grab:FireServer(Player,OtherPlr)
end
else
print("Mouse.Target ==" ..Mouse.Target.Name)
end
end)
alr so I'm trying to make a script that teleports a player to the player that clicked him, but it doesn't seem to work and It's even confusing, above is the LocalScript in the StarterPack, and below is the ServerScript
game.ReplicatedStorage.Grab.OnServerEvent:Connect(function(Player,OtherPlr)
OtherPlr.HumanoidRootPart.Position = Player.Character.HumanoidRootPart.Position
end)
The error I'm getting is
HumanoidRootPart is not a valid member of Player "Players.Player1"
Seems like it thinks that I'm referring to the player itself but I'm referring to the character... any knows why it gives me that error?

1 comment
put [solved] in the title and don't delete your post. will help future scripters