-
On a remote event being fired, the player will be handcuffed with welds.
-
The script won’t execute, but will print.
-
I have tried variations of the script to fix it.
print("recieved")
if player.Team == game.Teams.Police then
if value == "c" then
if target.cValue.Value == false then
player.PlayerGui.InteractiveMenu.Frame.g.Visible = true
print("cuffed")
target.cValue.Value = true
print(target.Name)
print("Test")
local Weld1 = Instance.new("Weld")
Weld1.Name = "Tool_Weld2"
Weld1.Part0 = target.Torso
Weld1.Part1 = target['Right Arm']
Weld1.Parent = target.Torso
Weld1.C1 = CFrame.new(-1 * .65, -.35, -.35) * CFrame.fromEulerAnglesXYZ(math.rad(17.5), math.rad(0), math.rad(-1 * -40))
local Weld2 = Instance.new("Weld")
Weld2.Name = "Tool_Weld3"
Weld2.Part0 = target.Torso
Weld2.Part1 = target['Left Arm']
Weld2.Parent = target.Torso
Weld2.C1 = CFrame.new(1 * .65, -.35, -.35) * CFrame.fromEulerAnglesXYZ(math.rad(17.5), math.rad(0), math.rad(1 * -40))
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://9048615510"
local Handcuffed = player.Character:WaitForChild("Humanoid"):LoadAnimation(Animation)
target.Humanoid.WalkSpeed = 8
if target.cValue.Value == true then
target.cValue.Value = false
player.PlayerGui.InteractiveMenu.Frame.g.Visible = false
target.Humanoid.WalkSpeed = 16
target.Torso["Tool_Weld2"]:Destroy()
target.Torso["Tool_Weld3"]:Destroy()
endgame.ReplicatedStorage.InteractionEvent.OnServerEvent:Connect(function(player, target, value)
print("recieved")
if player.Team == game.Teams.Police then
if value == "c" then
if target.cValue.Value == false then
player.PlayerGui.InteractiveMenu.Frame.g.Visible = true
print("cuffed")
target.cValue.Value = true
print(target.Name)
print("Test")
local Weld1 = Instance.new("Weld")
Weld1.Name = "Tool_Weld2"
Weld1.Part0 = target.Torso
Weld1.Part1 = target['Right Arm']
Weld1.Parent = target.Torso
Weld1.C1 = CFrame.new(-1 * .65, -.35, -.35) * CFrame.fromEulerAnglesXYZ(math.rad(17.5), math.rad(0), math.rad(-1 * -40))
local Weld2 = Instance.new("Weld")
Weld2.Name = "Tool_Weld3"
Weld2.Part0 = target.Torso
Weld2.Part1 = target['Left Arm']
Weld2.Parent = target.Torso
Weld2.C1 = CFrame.new(1 * .65, -.35, -.35) * CFrame.fromEulerAnglesXYZ(math.rad(17.5), math.rad(0), math.rad(1 * -40))
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://9048615510"
local Handcuffed = player.Character:WaitForChild("Humanoid"):LoadAnimation(Animation)
target.Humanoid.WalkSpeed = 8
if target.cValue.Value == true then
target.cValue.Value = false
player.PlayerGui.InteractiveMenu.Frame.g.Visible = false
target.Humanoid.WalkSpeed = 16
target.Torso["Tool_Weld2"]:Destroy()
target.Torso["Tool_Weld3"]:Destroy()
end