Hello everyone! I am working with somewhat teleknesis script which changes other player's position as the initial player drags his/her mouse but it shows abnormal values. This is what i have scripted till now:-
local player = game.Players.LocalPlayer local camera = game.Workspace.CurrentCamera local uis = game:GetService("UserInputService") local mouse = player:GetMouse() local attachedToPlayer = false local GotTarget = false local Target = nil local toggleOfUIS = false mouse.Move:Connect(function() if toggleOfUIS == false then if mouse.Target.Parent:FindFirstChild("Humanoid") then Target = mouse.Target GotTarget = true else Target = nil end else end end) uis.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.T then if toggleOfUIS == false then toggleOfUIS = true if GotTarget == true then attachedToPlayer = true repeat Target.Parent.HumanoidRootPart.Position = Target.Parent.HumanoidRootPart.Position + Vector3.new(mouse.X, mouse.Y, 0) wait(0.3) until toggleOfUIS == false or attachedToPlayer == false print(Target.Position) end elseif toggleOfUIS == true then toggleOfUIS = false attachedToPlayer = false end end end)
Please someone help!!