I was trying to do a script where a player can drag another player using a rope, everything worked as intended except for one part, the player's physics. Is there a way to change the player's state in a way where the player can feel like a dead person but not necessary be dead. The best results that i got is by enabling the platformstand but even then it doesn't feel the way it should.
This is the local script(just in case):
local uis = game:GetService("UserInputService") local grab = false uis.InputEnded:Connect(function(i, gpe) if i.KeyCode == Enum.KeyCode.Z and gpe == false then if grab == false then grab = true return end if grab == true then grab = false return end end end) spawn(function() script.Parent.Humanoid.Touched:Connect(function(hit) if grab == true then if hit.Parent:FindFirstChild("Humanoid") ~= nil then print("got you") game:GetService("ReplicatedStorage"):WaitForChild("just because"):FireServer(hit) grab = false return end if hit.Parent:FindFirstChild("Humanoid") == nil then grab = false print("Mission Failed, We Will Get Him Next Time") return end end end) end)
This is the script(just in case):
local reps = game:GetService("ReplicatedStorage") local jb = reps:WaitForChild("just because") jb.OnServerEvent:Connect(function(player, hit) hit.Parent.Humanoid:ChangeState(16) hit.Parent.Humanoid.PlatformStand = true local weld = Instance.new("RopeConstraint") weld.Name = "GOTYOU" weld.Parent = player.Character.RightHand weld.Attachment0 = player.Character.RightHand.RightGripAttachment weld.Attachment1 = hit.Parent.Head.NeckRigAttachment weld.Length = 10 weld.Visible = true end)
I would ragdoll the player being dragged so they look dead. While they are ragdolled, you can disable their inputs.
Here is a post by TheGamer101 on disabling inputs: https://devforum.roblox.com/t/how-to-temporarily-disable-all-character-input/178365/2?u=phantomvisual
For the ragdoll, I found a couple of scripts that you can use as a reference. These are from developers on the DevForum when ROBLOX released the Humanoid.BreakJointsOnDeath
property.
Fm_Trick: https://devforum.roblox.com/t/humanoid-breakjointsondeath/252053/13?u=phantomvisual
Nezuo: https://devforum.roblox.com/t/humanoid-breakjointsondeath/252053/17?u=phantomvisual
If you want to fake a death, you can use Humanoid:SetStateEnabled()
and set the Dead
state to false (or find a state that works with what you are trying to achieve).
https://developer.roblox.com/api-reference/function/Humanoid/SetStateEnabled
Experiment with these and hopefully you can get the outcome you want. Good luck!