Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I made cuff scripts but players can just reset out of them. How can I stop this?

Here's the server side script as the local script just fires the event:

local RemoteEvent = script.Parent.RemoteEvent
local Using = false
local TargetTorso

function CheckForChar(Part)
	if Part.Parent:IsA'Model' and Part.Parent:FindFirstChildOfClass'Humanoid' then
		local Char = Part.Parent
		local Torso
		if Char:FindFirstChild("Torso") then
			Torso = Char.Torso
		else 
			Torso = Char.UpperTorso
		end
		TargetTorso = Torso
		return Char
	end
end

function CheckForTorso(player)
	local Char = player.Character
	if Char:FindFirstChild("Torso") then
		return Char.Torso
	else 
		return Char.UpperTorso
	end
end

RemoteEvent.OnServerEvent:Connect(function(player, one, two)
	if one == 'Cuff' then
		
		local Target = CheckForChar(two)		
		local PlayerTorso = CheckForTorso(player)
		
		if Target then
			Using = true
			RemoteEvent:FireClient(player, 'Use')
			spawn(function()

				while Using and wait() do
					TargetTorso.Anchored = true
					TargetTorso.CFrame = PlayerTorso.CFrame * CFrame.new( 0, 0, -2.5 )
				
				end				
				
			end)			
			
		end
	
	elseif one == 'UnCuff'then
		
		Using = false		
		wait()
		TargetTorso.Anchored = false		
		
	end
	
end)

2 comments

0

This doesn't change anything?

0

You dont have to say it twice, incapaz.

1 answer

Just re-name the Target's humanoid, that prevents resetting. Try something like this:

Char.Humanoid.Name = "Target"

And rename it back to "Humanoid" to allow the player to reset again

3 comments

0

I'll try both solutions

0

That won't work. Roblox's RESET button uses Character:BreakJoints(), not humanoid.

0

It worked actually :) but thank you for suggestions

This discussion is preserved as it was. New answers, comments, and votes are closed.