Hello, I’m trying to create a regen that regenerates a ball that only the player can see.
Lets say for example, 2 players are on the stage where they need a ball, and there is only 1. I want it so that the 2 players can ride their own ball with one regen if that’s possible.
I tried turning the regen script into a local script but that didn’t work.
Could somebody help out? Thanks.
You just need to instance the parts locally, that way they will only be created & visible to the client which instanced them.
ok so to use local scripts:
-the local script must always be inside the player (game.Workspace.Players.“ThePlayer”) or inside the player’s character (game.Workspace.“ThePlayer”)
-everytime a local script does any changes the “changes” can be seen only by the “LocalPlayer” (the player that has the “LocalScript” and thats exactly what you want to do.
now what you need to do is simple you want to spawn a sphere with a local script and there is multiple easy ways to do it first of all you should insert a local script in the “StarterPlayerScripts” (game.StarterPlayer.StarterPlayerScripts) after doing this to start the localscript you can use a button a touchpart or an automatic loop to spawn the sphere just script a function (click or part touched or even just a loop) like you would do in a normal server script just remember to always use “local” when writing variables,
now to spawn the sphere you could also use an “instance.new” like said Forummer or else you could use the “ReplicatedStorage” to store the sphere in it then tell your local script to clone the sphere from ReplicatedStorage and put it in the Workspace.
I hope this will help you and you can also check localscripts in the DevHub here:
or check tutorials on youtube or in other topics.
Geniosity, Thanks!!! Appreciate it.