I don’t know how to make, I try to search that but nothing. ;(
My Tool:
My script: (ToolScript)
local tool = script.Parent
local player = game:GetService("Players").LocalPlayer
local reloadTime = 2
local range = 10
local rE = script.Parent:WaitForChild("Arrest")
tool.Enabled = true
tool.Equipped:connect(function(mouse)
print("Tool equipped!")
mouse.Button1Down:connect(function()
print("Mouse pressed!")
if not tool.Enabled then
return
end
tool.Enabled = false
local ray = Ray.new(tool.Handle.CFrame.p, (mouse.Hit.p - tool.Handle.CFrame.p).unit * range)
local part, position = workspace:FindPartOnRay(ray, player.Character, false, true)
if part then
local humanoid = part.Parent:FindFirstChild("Humanoid")
if not humanoid then
humanoid = part.Parent.Parent:FindFirstChild("Humanoid")
end
if humanoid then
local tarplr = humanoid.Parent
local stats = game.Players[tarplr.Name]:FindFirstChild("CanArrest")
if stats.Value == true then
game.Players[tarplr.Name].Team = game.Teams.Prisoner
print("Arresting")
rE:FireServer(tarplr)
else
print("Player cant arrest")
end
end
end
wait(reloadTime)
tool.Enabled = true
end)
end)
My script:(REArrest)
script.Parent:WaitForChild("Arrest").OnServerEvent:Connect(function(plr, tarplr)
if game.Players[tarplr.Name].Team ~= game.Teams.Police then
print(plr.Name.." is attempting to arrest")
print(plr.Name.." is attempting to arrest "..tarplr.Name)
game:GetService("Players")[tarplr.Name].Character.Humanoid.WalkSpeed = 0
game.Players[tarplr.Name].PlayerGui.Shift.Disabled = true
wait(15)
game:GetService("Players")[tarplr.Name].Character.Humanoid.WalkSpeed = 16
game.Players[tarplr.Name].PlayerGui.Shift.Disabled = false
game:GetService("Players")[tarplr.Name].Character.HumanoidRootPart.CFrame = CFrame.new(game.Workspace.TeleportPart.Position)
--change the above part to where you want the person teleported too
end
end)
Assuming you already have the animation created, you can load the animation into the desired Humanoid with LoadAnimation(), and play it with :Play().
Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://" .. AssetId --replace AssetId with the asset ID of your animation
AnimationTrack = Humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
It looks like your game is using R6. Be absolutely sure your animation can be loaded into an R6 rig via the animation editor plugin before trying to use it in-game or else it won’t load and won’t error.
You can do it either way. “…” is just a way to concatenate the two values together into one, and it allows you to implement a variable for the asset ID instead of using the entire string at once.
um you can’t do it either way unless 5690664285 is a variable and yes … is a way to concentrate two DIFFERENT values. you can put 2 strings but it is so much more efficient to use 1 string