So what I am trying to do is to point players right arm to mouse position. But For some reason, I get this error:
I am pretty sure that lookAt is a valid member of CFrame, which is weird. I tried searching for this issue on google, but got literally no results. Any help will be appriciated.
My script:
repeat wait(0.5) until game:IsLoaded()
local player = game.Players.LocalPlayer
local char = player.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local RightShoulder = char:WaitForChild("RightUpperArm")
local wpEquipped = false
script.Parent.Equipped:Connect(function()
wpEquipped = true
end)
script.Parent.Unequipped:Connect(function()
wpEquipped = false
end)
local function lookDirection()
if wpEquipped == true then
RightShoulder.CFrame.lookAt(player:GetMouse().Hit)
end
end
game["Run Service"].RenderStepped:Connect(lookDirection)