Why doesn’t this part position code work?

Why doesn’t this work?

local MOFF= Vector3.new(0,0,0)
local FL = script.Parent.Handle.CFrame.Position + script.Parent.Handle.CFrame:VectorToWorldSpace(MOFF)
local CFramey = CFrame.new(FL, Character.Humanoid.TargetPoint)
					
local LookVec = ShotCFrame.LookVector

Its to be called in a RemoteEvent’s fireserver but I can’t figure out why it isn’t working.

1 Like

Is there any errors in the developer console? A common issue is :FireServer() being called from a server script.

No. There’s no errors that I can see…

Alright, but is this code inside a Local or Server script?

Local Script.

Alright, if there’s no errors then I’m not sure what you should do. Odd, it should print an error or warning in the console to show the script failed.

If you go to the doctor’s and tell them “I’m sick”, they will ask you some questions. This is required in order to find the root cause of the problem. Likewise, you should elaborate on what is wrong, instead of simply saying “it isn’t working”.

2 Likes

I wasn’t I was just hoping you could see it :slight_smile:

See what? There’s not much to see.

1 Like

Could you at least provide a copy of a place for us to reproduce the issue?

I won’t be able to, I don’t have access to a PC right now.

This thread doesn’t have enough information attached to it. You can’t find out why it’s working so it’s crucial that you provide the details about your circumstances. Where is this code, what does your object hierarchy look like, all of those kinds of things should be answered.

It would do you well to understand the client-server model as well. It’s unclear what you’re referring to when you say FireServer, but code cannot run in fire server. FireServer is meant to be called by a LocalScript on a RemoteEvent to tell the server to do something: FireClient and FireAllClients is for the server to use to tell LocalScripts to do something.

With the above in mind: if this code is on the client-side, then your server script should be calling Fire(All)Client(s) and this code should be placed in an OnClientEvent connection to that remote.

P.S.: Your topic title was not concise as to what you were referring to by “this”, so I have expanded it to explicitly state what the content of this thread was about. Please be sure to use titles that summarise your situation.

2 Likes