Switching bodys

so I’m working on a football game and I need to make like when player press the keybind then he switch with bodys with other character and old player character dont die and becomes NPC and other one is controlling by player

I saw what that function is succesfuly working in My Soccer Team! ⚽ - Roblox and I was trying to do something like in this game

local char = game.Players.LocalPlayer.Character
local char1 = game.Workspace.char
local player = game.Players.LocalPlayer

local UIS = game:GetService("UserInputService")
local ControllerService = game:GetService("ControllerService")

local keybind = Enum.KeyCode.Q
local HumanoidController = ControllerService:FindFirstChildOfClass("HumanoidController")

local playerMod = require(game:GetService("Players").LocalPlayer.PlayerScripts:WaitForChild("PlayerModule"))
local controls = playerMod:GetControls()

that what I did at this moment but it’s not working what should I do?

1 Like