How to make a clone of a player copy same actions of what the player does (only jumping)

  1. What do you want to achieve? Keep it simple and clear!
    I want to make a clone of a player copy same actions of what the player does (single player game)
  2. What is the issue? Include screenshots / videos if possible!
    I am unsure on how to do this, however I only need to check when the player jumps, then if the player jumps the clone jumps as well.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I cannot find any solutions on Dev-Forum, not sure if my searching skills are bad.
1 Like

I will give you 2 methods

— I will assume your clone has been defined 
local UIS = game:GetService(“UserInputService”) 
UIS.JumpRequest:Connect(function()
   clone.Humanoid.Jump = true

— I will assume your clone has been defined 
local UIS = game:GetService(“UserInputService”) 
UIS.InputBegan:Connect(function(i,p)
   if p then return end
   if i.UserInputState = Enum.UserInputState.Begin and i.Keycode = Enum.Keycode.Space then
      clone.Humanoid.Jump = true
   end

What’s going on here is that the script is listening for when the player is going to jump then makes the clone jump too

You can replace clone.Humanoid.Jump = true with clone.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping, if the former doesn’t work

1 Like

Should this be in a local script or a server script (My game is single player)

Local script, only local script can detect player input

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.