Correct team doesn't receive tools

I was looking at cookies cuff system tutorial I managed to do everything but the cuff assign group thing isn’t working, could you please help me with this?

local GroupId = 16532543 
local MinId = 6 

game.Players.PlayerAdded:Connect(function(Player)
     if Player:GetRankInGroup(GroupId) >= MinId then 
          wait(5)
          local Cloned_Tool = game.ReplicatedStorage.ArrestSystem.Model.Cuffs:Clone()
          Cloned_Tool.Parent = Player.Backpack
    end 
end)
1 Like

Hi! Can you edit this topic for it to the correct category?

1 Like

Okay, so a couple of things, just to confirm - the cuffs aren’t already in PlayerTools, right?

Cuffs are in the replicated storage

Check logs, you’re not getting any errors, right?

Can you send as text using code tags please?

image

Also contain as must as you can.

FireClient: player argument must be a Player object - Server - ArrestMechanics:8

Like this?

Copy and paste the contents of ArrestMechanics here.

image

Use this button on the top bar though.

image

local ReplicatedStorage = game:GetService("ReplicatedStorage").ArrestSystem 

local ArrestUser = ReplicatedStorage:WaitForChild("ArrestUser")
local ReleaseUser = ReplicatedStorage:WaitForChild("ReleaseUser")
local AntiReset = ReplicatedStorage:WaitForChild("AntiReset")
 
local function AntiResetF(PlayerInstance, Status)
	AntiReset:FireClient(PlayerInstance, Status)
end

local function ReleaseUserF(Player)
	local P2 = Player.Character.HumanoidRootPart.CuffWeld.Part1
	local P2Instance = game.Players:FindFirstChild(P2.Parent.Name)

	Player.Character.HumanoidRootPart.CuffWeld:Destroy()

	for i,v in ipairs(P2.Parent:GetDescendants()) do 
		if v:IsA("MeshPart") then
			v.Massless = false
		end
	end

	P2.Parent.Humanoid.WalkSpeed = 16
	P2.Parent.Humanoid.JumpPower = 50

	P2.Parent.Humanoid.PlatformStand = false
 
	AntiResetF(P2Instance, true)
end

ArrestUser.OnServerEvent:Connect(function(Player, Victim)
	local PlayerInstance = game.Players:FindFirstChild(Victim.Parent.Name)	
	local P1 = Player.Character.HumanoidRootPart
	local P2 = Victim


	local offset = Vector3.new(0,0.015,-2)
	Victim.CFrame = P1.CFrame*CFrame.new(offset)

	local NewConstraint = Instance.new("WeldConstraint")
	NewConstraint.Parent = P1

	NewConstraint.Part0 = P1
	NewConstraint.Part1 = P2
	NewConstraint.Name = "CuffWeld"

	P2.Parent.Humanoid.PlatformStand = true

	Victim.Parent.Humanoid.WalkSpeed = 0
	Victim.Parent.Humanoid.JumpPower = 0 	

	for i,v in ipairs(Victim.Parent:GetDescendants()) do 
		if v:IsA("MeshPart") then
			v.Massless = true
		end
	end

	AntiResetF(PlayerInstance, false)
	print("Arrest!")
end)

ReleaseUser.OnServerEvent:Connect(function(Player)
	ReleaseUserF(Player)
end)

Are you testing this on an actual player or on a dummy?

Also, what is the issue with the “correct team”? I feel like this may be a unrelated issue we don’t need worry about.

On your video you said if we wanna make a script for only a specific rank and group then we write that script, but the thing is on the game everyone that isn’t in the group also has the cuffs. And I am testing this on a dummy

Okay, so let’s focus on the group issue, can you send me a screenshot of “Starter Pack”?

There isn’t anything in StarterPack.

In the video you didn’t add anything in the StarterPack.

No, this is a good thing.

Just to make suer you have set the Min Id correct, right?

1 Like

Yes, I made it as rank 6.

How are you testing this?

I just go in game I have 2 teams made one that isn’t supposed to have it and the other is supposed to have it but the one that isn’t supposed to have it has it