How to get a player Location on Roblox --(like blade ball flats)

last time i was trying to made First Person system so i made a script just can apply player look up and down.
the problem is , its just work on local but its doesn’t work on server, if someone can help me because i really didnt understand, some stuff work normally with localscript and some other doesnt work

on local player:


on the server:

parent script is “StarterCharacterScripts”
script :

local char = game.Players.LocalPlayer.Character
local cam = game.Workspace.CurrentCamera 
local neck = char:WaitForChild("Torso"):WaitForChild("Neck") 
local rotateChar = char:WaitForChild("HumanoidRootPart"):WaitForChild("RootJoint")
local LeftHip = char:WaitForChild("Torso"):WaitForChild("Left Hip")
local RightHip = char:WaitForChild("Torso"):WaitForChild("Right Hip")
game["Run Service"].RenderStepped:Connect(function()
	neck.C0 = CFrame.new(neck.C0.Position) 
		* (CFrame.Angles(math.pi/2,math.pi,0)
			* CFrame.Angles(-cam.CFrame.LookVector.Y * 1/2,0,0)
		)
	rotateChar.C0 = CFrame.new(neck.C0.Position) 
		* (CFrame.Angles(math.pi/2,math.pi,0)
			* CFrame.Angles(-cam.CFrame.LookVector.Y * 1/2,0,0)
		)
	LeftHip.C0 = CFrame.new(LeftHip.C0.Position) 
		* (CFrame.Angles(0,-math.pi/2,0)
			* CFrame.Angles(0,0,-cam.CFrame.LookVector.Y * 1/1.5)
		)
	RightHip.C0 = CFrame.new(RightHip.C0.Position)
		* (CFrame.Angles(0,math.pi/2,0)
			* CFrame.Angles(0,0,-cam.CFrame.LookVector.Y * 1/1.5)
		)
end)
-- pls help :D
3 Likes

The problem is that local scripts only affect the client’s device. While server scripts affect the whole server. You could have the local script detect the player’s camera positions. But set the C0’s with a server script in serverscriptservice via a remote function. For More Info on the difference between the two: https://devforum.roblox.com/t/what%E2%80%99s-the-difference-between-a-local-script-and-a-server-script/2452614

2 Likes

soo… all need to do is add remoteEvent :smiley: because the server doesn’t know what is the cameraCFrame … right?

With the local script send the variables over to a server script via a remote event. If your confused on remote events you can use this: https://www.youtube.com/watch?v=lt9BrTOsPNY

1 Like

okey i really understand thank you so much <3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.