How to edit player module?

Hi, I need to make some changes to player module, is it possible, if yes, how? I tried this, but it isnt working

game.Players.PlayerAdded:Connect(function (plr) 
for _,camScript in pairs(game.ServerStorage["script templates"].CustomPlayerModule.Camera:getChildren()) do
	plr:waitForChild("PlayerScripts").PlayerModule.CameraModule[camScript.Name]=camScript:Clone()
	print("edited")
end
end)
1 Like

Just fork the PlayerModule?

As for your code not working, this is why you apply basic debugging or read documentation before posting threads. PlayerScripts cannot be accessed by the server.

1 Like

Oh ok, I was confused, bec when i start writing, the autocorrect will give me it as option even on server.

I tried this

local plr = game.Players.LocalPlayer 
for _,camScript in pairs(game.ReplicatedStorage["script templates"].CustomPlayerModule.Camera:getChildren()) do
	plr:waitForChild("PlayerScripts"):waitForChild("PlayerModule").CameraModule:WaitForChild(camScript.Name):Destroy()
	camScript:Clone().Parent = plr.PlayerScripts.PlayerModule.CameraModule
	print("edited")
end

but it doesnt work

Againā€¦ just fork the PlayerModule and replace the modules from there. Thereā€™s no reason to code this in. The module arenā€™t automatically reloaded when you replace them either. Everything is required once.

Where even are you running this script from?

1 Like

It doesnā€™t feel like you have any experience in programming. Printing ā€œeditedā€ wonā€™t edit it. What you should do is go inside the game and in players locate what you want, copy paste it somewhere afterwards. Make changes to that module and when you are done place it in Replicated/Server Storage.

And now with a script write something like this

local RS = game:GetService("ReplicatedStorage")
game.Players.PlayerAdded:Connect(function(player)
	local betterCam = RS:WaitForChild("whateverYouHaveHere")
	betterCam.Parent = findOutTheLocationYourself
end)

REMEMBER I CANā€™T EMPHASISE THIS ENOUGH! You canā€™t just print ā€œeditedā€ for it to be edited. You need to make actual changes to the script you have now placed (somewhere) if you have followed my instructions.

it was just feedback for myself

You canā€™t make any changes remotely from another script. YOU made NOTHING to iterate the code you wanted and called it a day with ā€œprint(ā€œeditedā€)ā€

I have told you this. If you want to have a custom module. Replace the module with something you have edited through the script editor. Your question was ā€œHOW TO EDIT PLAYER MODULEā€ not how to replace them. It is as simple as going inside themā€¦ And IF FOR SOME REASON, you did word it wrong. Then I suggest you change the title to ā€œHow to replace player modules with custom onesā€

look on my script there is this (exactly what you are saying)

Ok, tell me how to edit them without replacing.

1 Like

. Did you read what I said?

You canā€™t make any changes remotely from another script.

Ya, and i knew it before, but if replacing the player module is only way how to edit it, why the topic title is bad

1 Like

ā€¦ I donā€™t know if you are serious or not but the title is misleading. Look up the definition of ā€˜editingā€™ please and change your title. Secondly make this topic solved because you have already gotten all the necessary information.

idk who is buged, but for me, it solved

What do you mean by ā€œforkā€ the PlayerModule?

Sorry Iā€™m new

Means taking your own copy to modify.