-
What do you want to achieve?
I’m trying to insert a motor inside the torso for a tool animation. The tool has no handle so I use part parents to detect when it is equipped or not. -
What is the issue?
When I try to use the player model as an argument for a remote function, the function returns a boolean for it instead of the model -
What solutions have you tried so far?
I’ve looked for solutions, but so far I have found none.
Server Script
motorConnect.OnServerInvoke = function(motor,bodyAttach,connect,playerModel)
print(playerModel) -- this returned a boolean in the console instead of the model
if motor.Parent.Name ~= "Torso" then
motor.Parent = playerModel:WaitForChild("Torso")
motor.Part0 = playerModel:WaitForChild("Torso")
end
if connect then
motor.Part1 = bodyAttach
else
motor.Part1 = nil
end
end
Local Script
local players = game:GetService("Players")
local char = players.LocalPlayer.Character
tool:GetPropertyChangedSignal("Parent"):Connect(function()
if tool.Parent.Name == char.Name then
motorConnect:InvokeServer(motor,bodyAttach,true,char)
animFunc:InvokeServer("Hold",true,char)
end
end)