Hello , I’m doing the tool that will allow to control other player if the mouse pointed to player and you press “X” Button . I made some script in the tool you can see it here :
``local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Ghost = math.random(player,1)
local UIS = game:GetService(“UserInputService”)
local RepStorage = game:GetService(“ReplicatedStorage”)
local function GetPlayer()
if mouse.target ~= "HumanoidRootPart" and script.Parent.Parent.Equipped == true then
Input.InputBegun.KeyCode = Enum.KeyCode.X
if player == Ghost then
local Target = mouse.target.Parent:Copy()
local PlayerCharacter = player.Character:Copy()
PlayerCharacter.Parent = RepStorage
Target.Parent = player
wait(0.1)
player.Character:Destroy()
Target.Name = player.Name
print("Well well well , we are on half way")
else
if mouse.target ~= nil or "part" and script.Parent.Parent.Equipped == true then
Input.InputBegun.KeyCode = Enum.KeyCode.X
if player == Ghost then
local RepCharacter = RepStorage:FindFirstChild(player.Name):Copy()
RepCharacter.Parent = player
RepCharacter.Name = player.Name
print("Final line of script")
end
end
end
I tried it but it doesn’t work at all and I tried to do it for 3 days so I wanted to ask for help from more advenced developers , Thanks !