So I am trying to create a command that will allow administrators to jail other players. However, I am not too sure where I went wrong. Here is my script:
local prefix = ":"
local group = 8708530 -- current beta tester group
local newJailedVal = script.HolderVals.JailedCopy:Clone()
newJailedVal.Name = "Jailed"
newJailedVal.Value = false
newJailedVal.Parent = game.Workspace:WaitForChild(plr.Name)
local msg = message:split(" ")
if msg == prefix.."jail" and plr:GetRankInGroup(group) >= 9 then
local target = msg
if game.Workspace:WaitForChild(target).Jailed.Value == false then
target.Character.HumanoidRootPart.CFrame = workspace.Jail.Teleporter.CFrame*CFrame.new(0,3,0)
Infinite yeld possible…
That would mean it does not find your target?
It would be a little helpful if I could see the yellow error, but I’m assuming either the ‘Jailed’ BoolValue is not being found or the ‘target’ but I highly doubt it is the target.