Recreating Infectious smile grabbing players system

  1. I want to make a player grab another player like the example from the most recent roblox hit, infectious smile.

  2. I haven’t figured out a good or practical way to do it.

  3. 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.
2 Likes

I believe you need to run animations on the server, so you should use a RemoteEvent to fire data between the client and the server, then play the animation on the server. Input detection should almost always be client-sided.

2 Likes

Why should it always be client sided

Most input services and events only work with the client besides things like touched events.

2 Likes