Hello,
I’m having issues with moving a ragdoll by using SetPrimaryPartCFrame().
Every time i run the script, this error shows up:
ServerScriptService.RagdollSpawner:2: attempt to index nil with 'SetPrimaryPartCFrame'
(Im using remote events to make the ragdolls spawn at the given position)
The lines of code that fire the server:
local RagdollCharacter = game.ReplicatedStorage.RagdollPlayerCharacter
local Position = game.Workspace.PlayerCharacter1:GetPrimaryPartCFrame()
local RagdollClone = RagdollCharacter:Clone()
RagdollClone.Parent = game.Workspace
game.ReplicatedStorage.SpawnRagdoll:FireServer(RagdollClone, Position)
The remote event script:
game.ReplicatedStorage.SpawnRagdoll.OnServerEvent:Connect(function(Player, Ragdoll, Position)
Ragdoll:SetPrimaryPartCFrame(Position)
end)
I cant find any errors in both of my scripts, there are also no topics that have proper answers to this error.
Any help is appreciated.