-
What do you want to achieve?
I am trying to make a GUI which when you click it all the players touching a part will get welded and not be able to move or jump.
Note : Part can move that’s why I am using weldconstraints -
What is the issue?
The character weirdy freezes, I want to freeze it in a still pose. -
What solutions have you tried so far?
I looked for solutions on the developer hub and I couldn’t find anyone with the same issue. And I simply don’t know what to do.
CODE:
local repEvent = game.ReplicatedStorage.Events.WeldThisNoob
local part = game.Workspace.Part
local eventOff = game.ReplicatedStorage.Events.UnWeldThisNoob
repEvent.OnServerEvent:Connect(function()
part.Touched:Connect(function(hit)
hit.Parent.Humanoid.WalkSpeed = 0
hit.Parent.Humanoid.JumpPower = false
local LeftFoot = Instance.new("WeldConstraint")
LeftFoot.Parent = hit.Parent
LeftFoot.Part0 = part
LeftFoot.Part1 = hit.Parent["Left Leg"]
local RightFoot = Instance.new("WeldConstraint")
RightFoot.Parent = hit.Parent
RightFoot.Part0 = part
RightFoot.Part1 = hit.Parent["Right Leg"]
local RightArm = Instance.new("WeldConstraint")
RightArm.Parent = hit.Parent
RightArm.Part0 = part
RightArm.Part1 = hit.Parent["Right Arm"]
local LeftArm = Instance.new("WeldConstraint")
LeftArm.Parent = hit.Parent
LeftArm.Part0 = part
LeftArm.Part1 = hit.Parent["Left Arm"]
local Head = Instance.new("WeldConstraint")
Head.Parent = hit.Parent
Head.Part0 = part
Head.Part1 = hit.Parent["Head"]
local Torso = Instance.new("WeldConstraint")
Torso.Parent = hit.Parent
Torso.Part0 = part
Torso.Part1 = hit.Parent["Torso"]
local HRP = Instance.new("WeldConstraint")
HRP.Parent = hit.Parent
HRP.Part0 = part
HRP.Part1 = hit.Parent["HumanoidRootPart"]
return hit
end)
end)
A pic of what happening