Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make this script work to undetain a player?

Asked by
orcazate 170
5 years ago

Hi! So the script I'm linking below doesn't work. t's meant to undetain a player when they unequip a tool except it doesn't work. No errors

01local players = game:GetService("Players")
02local player = players.LocalPlayer
03local mouse = player:GetMouse()
04local targetplayer = script.Parent.Parent.PlayerGui:WaitForChild("ArrestDetails",5).Frame.TextLabel.name.Value
05 
06mouse.Button1Down:Connect(function()
07    if mouse.Target.Parent:FindFirstChild("Humanoid") then
08        if game.Workspace[player.Name]:FindFirstChild("Arrest") then
09            local targettedplayer = mouse.Target.Parent.Name
10            print(targettedplayer)
11            player.PlayerGui.ArrestDetails.Frame.TextLabel.Text = "Target Player: "..targettedplayer
12            player.PlayerGui.ArrestDetails.Frame.TextLabel.name.Value = targettedplayer
13            local userId = player.UserId
14            local thumbType = Enum.ThumbnailType.HeadShot
15            local thumbSize = Enum.ThumbnailSize.Size420x420
View all 86 lines...

Answer this question