I have a script that works exactly as intended except for shift-lock getting in my way.
local RS = game:GetService("ReplicatedStorage")
local BlinkStrike = RS:WaitForChild("BlinkStrike")
local function onBlinkStrike(Player, MHP)
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Player.Character:WaitForChild("Humanoid") -- basic variables
local Root = Character.HumanoidRootPart
local ray = Ray.new(Character.HumanoidRootPart.CFrame.p, --casting the ray
(MHP - Character.HumanoidRootPart.CFrame.p).unit * 50)
local part, position = workspace:FindPartOnRay(ray, Player.Character, false, true)
if part and part.Parent:FindFirstChild("Humanoid") then --if it's a player
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if player then
local target = player.Character.HumanoidRootPart
if player.Character.Humanoid.Health > 0 and Humanoid.Health > 0 then -if both still alive...
Root.CFrame = target.CFrame + (target.CFrame.lookVector * (-3)) --tp behind target
wait (0.001)
Root.CFrame = CFrame.new(Root.Position, target.Position) --turn towards their back <-- here's the issue
end
end
end
end
While shift-lock is on, as soon as i rotate the player it just rotates him back towards the cursor, thus if i'm aiming at the player facing me i teleport behind him facing the wrong way and i haven't found a way to fix this as i can't find a way to change the camera direction as i'd have to send data back from server to client, and manipulating shift-lock through scripts seems impossible

8 comments
Also, isn't it caps-lock ??
xD changed it, and no it's shift-lock for me at least
game.StarterPlayer.EnableMouseLockOption = false completely disables shift lock
does nothing and gives no errors
Cant you turn it off?
apparently not, i've shifted to instead changing where the player's camera is looking at but camera.Focus = CFrame.new(0,0,0) does nothing at all and it prints afterwards so i know it runs
well i've managed to turn it off but if it was turned on before i disabled it the camera still follows the cursor
you need to set the StarterPlayer property in studio otherwise it won't apply to players who have already joined, you can manually set a player's ability to shiftlock with https://developer.roblox.com/api-reference/property/Player/DevEnableMouseLock