For some reason, after running :LoadCharacter, the code following it just doesn’t run at all and even when I insert a print statement after the :LoadCharacter, it doesn’t print anything, this is my code:
game.ReplicatedStorage.arrestEvent.OnServerEvent:Connect(function(plr, arrestedplrname, duration)
if script.Parent.Parent.Name == arrestedplrname then
cuffed = false
grabbed = false
local arrestedchar = script.Parent.Parent
local arrestedplr = game.Players:FindFirstChild(arrestedplrname)
arrestedplr:LoadCharacter()
arrestedplr.CharacterAdded:Wait()
local arrestedchar = workspace:FindFirstChild(arrestedplr.Name)
arrestedchar.HumanoidRootPart.Position = workspace[math.random(1,3)].Position
arrestedplr.PlayerGui.custodyGUI.box.Text = "You have been arrested for " .. duration .. " minutes"
game:GetService("TweenService"):Create(arrestedplr.PlayerGui.custodyGUI.box, TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.Out), {Position = UDim2.new({0.152, 0},{0.251, 0})}):Play()
wait(3)
game:GetService("TweenService"):Create(arrestedplr.PlayerGui.custodyGUI.box, TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.Out), {Position = UDim2.new({0.152, 0},{-0.201, 0})}):Play()
end
end)