Hey! My name is [redacted] I am an intermediate scripter and I needed to create a simple ragdoll Tool, and anything I seem to do does not work, Please Help!
Script so far:
local debounce = false
script.Parent.Touched:Connect(function(hit)
local HumanoidRootPart = hit.Parent:FindFirstChild(“HumanoidRootPart”)
if HumanoidRootPart and debounce == false then
debounce = true
print(hit.Name)
local mag = (HumanoidRootPart.Position - script.Parent.Position).Magnitude
if mag <= 10 then --player is within 10 studs of the object, change to however close you want them to stay to the part. If you want them to touch the part the entire time, then it will require a little guess and check to get the number right.
print(“initial contact reached”)
wait(5)–change this to however many seconds you want the player to touch the part
local mag2 = (HumanoidRootPart.Position - script.Parent.Position).Magnitude
if mag2 <= 10 then
–code to input ragdoll effect
wait(3)
debounce = true
end
end
end
end)
Please send scripts through/Advice Down below!