How to lift people in the air and control they with the mouse

Hi, i want be able lit people in the air like telekinesis power but i’m not an advanced scripter and i don’t know how i can make that

Oh lmao I already helped someone with this script this week.
paste this in starterpack inside a local script:

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local uis = game:GetService("UserInputService")
local camera = workspace.CurrentCamera

local teleEnabled = false
local targetedModel = nil
local maxRange = 25

mouse.Button1Down:Connect(function()
	local target = mouse.Target
	if target and target.Parent:FindFirstChild("Humanoid") then
		teleEnabled = true
		targetedModel = target.Parent.PrimaryPart
		local bp = Instance.new("BodyPosition", targetedModel)
		bp.MaxForce = Vector3.new(5e5,5e5,5e5)
		bp.Position = player.Character.HumanoidRootPart.Position
	end
end)

mouse.Button1Up:Connect(function()
	teleEnabled = false
	if targetedModel and targetedModel:FindFirstChild("BodyPosition") then
		targetedModel.BodyPosition:Destroy()
	end
	targetedModel = nil
end)

mouse.Move:Connect(function()
	if teleEnabled == true then
		if targetedModel then
			local location = camera.CFrame.Position + (mouse.Hit.Position - camera.CFrame.Position).Unit * maxRange
			targetedModel.BodyPosition.Position = location
		end
	end
end)
2 Likes

But if it’s inside a local script it’s just in local

And i don’t know why i can’t add this in my script

elseif action == "TelekinesisBegin" then
		if CanUsePower then
			local camera = workspace.CurrentCamera

			local target = mouse.Target
			if target and target.Parent:FindFirstChild("Humanoid") then
				teleEnabled = true
				targetedModel = target.Parent.PrimaryPart
				local bp = Instance.new("BodyPosition", targetedModel)
				bp.MaxForce = Vector3.new(5e5,5e5,5e5)
				bp.Position = Player.Character.HumanoidRootPart.Position
			end
			
			
			
			mouse.Move:Connect(function()
				if teleEnabled == true then
					if targetedModel then
						local location = camera.CFrame.Position + (mouse.Hit.Position - camera.CFrame.Position).Unit * maxRange
						targetedModel.BodyPosition.Position = location
					end
				end
			end)
			
elseif action == "TelekinesisEnd" then
	teleEnabled = false
	if targetedModel and targetedModel:FindFirstChild("BodyPosition") then
		targetedModel.BodyPosition:Destroy()
	end
	targetedModel = nil
end

It’s not me it’s your script i make what do u want but it’s still not working

mate… since it utilizes bodymovers, it appears on every client.

…im a programmer, remember?

1 Like