I made some Handcuffs that teleport a player when you click on them. But, For some odd reason It doesn't do ANYTHING. Here is the handcuffs LocalScript:
local prisons = game.Workspace.Prison:GetChildren()
local RemoteEvent = game.ReplicatedStorage.SwitchToPrisoner
script.Parent.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
if mouse then
if mouse.Target.Parent:isA("Accessory") then
if (script.Parent.Parent.Head.Position - mouse.Target.Parent.Parent.Head.Position).magnitude <= 5 then -- Change "10" if you want to. This is the range of the arrest tool. The higher the number the longer the range you can arrest the player
if game.Players[mouse.Target.Parent.Parent.Name].Team == "Criminals" then
local char = mouse.Target.Parent.Parent
local CriminalName = char.Name
RemoteEvent:FireServer(CriminalName, char, prisons)
end
end
end
if mouse.Target.Parent.Humanoid then
if mouse.Target:isA("Part") or mouse.Target:isA("UnionOperation") or mouse.Target:isA("MeshPart") then
if game.Players[mouse.Target.Parent.Name].Team == "Criminals" then
local char = mouse.Target.Parent
local CriminalName = char.Name
RemoteEvent:FireServer(CriminalName, char, prisons)
char.HumanoidRootPart.CFrame = prisons[math.random(1,#prisons)].CFrame + Vector3.new(0,3,0) -- Same as this
end
end
end
end
end)
end)
It fires the remote event. Here is the "Server Sided Code":
local RemoteEvent = game.ReplicatedStorage.SwitchToPrisoner
RemoteEvent.OnServerEvent:Connect(function(player, CriminalName, char, prisons)
if game.Players.LocalPlayer == CriminalName then
char.HumanoidRootPart.CFrame = prisons[math.random(1,#prisons)].CFrame + Vector3.new(0,3,0)
end
end)
Do you see any errors? Please let me know and answer me if you can.

7 comments
put all your code in a code block..
Ok
Why do you have game.Players.LocalPlayer in a serversided code? Put that value in a tuple argument.
How do you do that?
replace game.Players.LocalPlayer with player
also, replace the + Vector3.new(0,3,0) with * CFrame.new(0,3,0)
Ok I will try that out.