-
I want to make a player grab another player like the example from the most recent roblox hit, infectious smile.
-
I haven’t figured out a good or practical way to do it.
-
I already have scripted the animation and I thought of making a basePart that is in my character’s model. When a event in my animation is reached, I am going to use that basePart and set up a Touch event. If another player (not a zombie) touches it, then send an remote event to that player to change his position to my basePart.CFrame.
Local script located inside my character
local userInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local player = 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")
-- Create new "Animation" instance
local grabAnimation = Instance.new("Animation")
-- Set its "AnimationId" to the corresponding animation asset ID
grabAnimation.AnimationId = "rbxassetid://6160656346"
local grabAnimationTrack = animator:LoadAnimation(grabAnimation)
local function grabHuman(input, gameProcessedEvent)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
grabAnimationTrack:Play()
end
end
userInputService.InputBegan:Connect(grabHuman)
grabAnimationTrack:GetMarkerReachedSignal("Create"):Connect(function(paramString)
grabAnimationTrack:AdjustSpeed(0)
end)
``` Any help would be awesome.