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)
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.
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
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.
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.
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ā
ā¦ 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.