I can’t find another way to reference it, all it does is reference the player inside the workspace, not the Player service that’s outside of workspace.
I’ve tried other ways to reference it but it gives me an error that it can’t find the children inside the Player service.
You’re trying to reference: Players[Player.Name].PlayerScripts.ClientFX,
but what you’re referencing to in the script is: Players[Player.Name].PlayerScripts.CameraPos
instead change:
You cannot access PlayerScripts from the server (for whatever reason).
I go around this restriction by using PlayerGui for any LocalScript I need to give or remove:
script.Parent.OnServerEvent:Connect(function(Player,Target)
if Target then
--// Get ClientFX from PlayerGui \\--
local ClientFX = Player.PlayerGui:FindFirstChild("ClientFX")
if ClientFX then
--// Remove CameraPos
ClientFX:Destroy()
end
end
end)