So currently i m trying to make grab plr and throw system
heres my script :
local grabRemoteEvent = game.ReplicatedStorage:WaitForChild("BrolyGrabRemoteEvent")
grabRemoteEvent.OnServerEvent:Connect(function(player,target)
if target:FindFirstChild("HumanoidRootPart") then
local targetHumanoidRootPart = target:FindFirstChild("HumanoidRootPart")
end
end)
local script:
local tool = script.Parent
local player = game.Players.LocalPlayer
local character = player.Character
if not character or not character.Parent then
character = player.CharacterAdded:Wait()
end
local humanoid = character:WaitForChild("Humanoid")
local Animator = humanoid:WaitForChild("Animator")
local mouse = player:GetMouse()
local grabRemoteEvent = game.ReplicatedStorage:WaitForChild("BrolyGrabRemoteEvent")
local UserInputService = game:GetService("UserInputService")
local animationsFolder = script.Parent.Animations
-- Animations
local brolyGrabPlayerAnimation = animationsFolder:FindFirstChild("BrolyGrabPlayer")
local brolyGrabTargetAnimation = animationsFolder:FindFirstChild("BrolyGrabTarget")
--Animations Track
local brolyGrabPlayerAnimationTrack = Animator:LoadAnimation(brolyGrabPlayerAnimation)
local brolyGrabTargetAnimationTrack = Animator:LoadAnimation(brolyGrabTargetAnimation)
local weld
tool.Equipped:Connect(function()
UserInputService.InputBegan:Connect(function(input,gp)
if input.KeyCode == Enum.KeyCode.E then
if mouse.Target.Parent:FindFirstChild("Humanoid") then
grabRemoteEvent:FireServer(mouse.Target.Parent)
local targetPlayer = mouse.Target.Parent
local targetHumanoidRootPart = targetPlayer:FindFirstChild("HumanoidRootPart")
weld = Instance.new("Weld")
weld.Name = "GrabWeld"
weld.Part0 = targetHumanoidRootPart
weld.Part1 = script.Parent.Handle
weld.Parent = script.Parent
end
end
end)
end)
tool.Unequipped:Connect(function()
if weld then
weld:Destroy()
end
end)
heres the image of the dummy when i grab it:
- problems i am currently facing: i cant move fast with plr and then i want to make the targetplr [dummy here] face like this:
i looked at - I can't manage to make a grabbing player system
but it didn’t help
hope someone can help on this , thx