Okay, see you when you’re back
Hey! I’m back from school now!
Let me try that out really quick!
Where should I write this? I’m not sure where to put it.
it didnt do anything
Sure! Let me type it in really quick.
I did it, but…
local swordd = sword:Clone()
swordd.Parent = workspace
swordd.Anchored = true
swordd.Transparency = 0
swordd.CFrame = CFrame.new(npc.Torso.Position + Vector3.new(0,3,0))
local cf = CFrame.lookAt(swordd.Position, mouseHit)
swordd.CFrame = CFrame.new(swordd.Position, swordd.Position - cf)
Sorry…
Try moving the ‘math.pi/2’ part to a different value
For example:
Try CFrame.Angles(0, math.pi/2, 0) or CFrame.Angles(0, 0, math.pi/2)
Almost forgot to mention, I did move the math.pi around.
swordd.CFrame = CFrame.new(npc.Torso.Position+(mouseHit-npc.Torso.Position).unit*3, mouseHit-((mouseHit-npc.Torso.Position).unit*(mouseHit-npc.Torso.Position).magnitude))
Try this, and tell me the results.
my bad, i meant to put cf.LookVector
instead of just cf
on that last line
Okay, hear me out.
I think this might be the solution to your problem but theres a chance that will not be the case.
Try this:
local swordd = sword:Clone()
swordd.Parent = workspace
swordd.Anchored = true
swordd.Transparency = 0
swordd.CFrame = CFrame.new(npc.Torso.Position + Vector3.new(0,3,0), -mouseHit)
So basically in a CFrame value there are two numbers. One is the position, and one is the position that the CFrame’s ‘.LookVector’ will face towards.
Since your sword is facing the opposite direction to your likings, I inverted the ‘mouseHit’ point which will probably solve your issue.
Tell me if it works, please.
Thanks.
To fix that issue you could multiply the -mouseHit
by Vector3.new(1,-1, 1)
to reverse the Y (solving the slightly above/vice versa situation)
Hey guys, I’ve just come back after a while of inactivity, I’ll be checking your solutions. Have a nice day!
I made all of the vector 3 values negative since it was offset in basically every direction… it didn’t work. It didn’t really make a difference.
Sorry, it didn’t change anything, but it did shorten my code by a little bit.
Since it’s taking a while to solve this, I’ll give you all the AssetID of the thing. All you have to do is insert it into the workspace, edit the code to your liking, and to test, you do require(workspace.MainModule)(‘username here’) on the serverside part of the developer console.
It kicks me out of the doge and respawns my character shortly after going requiring the module
require the module in the server side of the developer console
Go to the Developer Console > Click on “Server” button > insert “require(workspace.MainModule)(‘username’)” into the Command Line at the bottom of the Developer Console