How do i make a local part

Hello. I am wanting to make a local part (a part different for every player) kind of like the coin in MM2.

I have tried putting the part in replicated storage and duplicating it in Workspace with a local script.

1 Like

Did it not work when you tried to clone the part from replicated storage? What’s the issue?

When I tried to clone it, nothing happened.

Can I see your script?

iowejdiqwjidojqoiwdjoqwjd

I was trying to show it but I can’t format the code.

Click on reply > Preformatted text > paste your code where it tells you to

This is under a part under a model.

script.Parent.Parent:Clone().Parent = workspace

Could you show me your explorer layout?

It’s a localscript.
image

No scripts work in ReplicatedStorage and LocalScripts only work when it is parented under Player.Character or Player.PlayerScripts

Scripts and local scripts do not run inside replicated storage. You should probably put a local script in StarterPlayerScripts and reference the part from there.

An example:

-- inside local script

local RS = game:GetService("ReplicatedStorage")
local coin = RS.coins.coin7.coin -- or whatever part you want to clone

local newCoin = coin:Clone()
newCoin.parent = game.Workspace
-- coin rotation and player detection down here

EDIT: small typo, oopsies

StarterCharacterScripts would be better for this if OP didn’t want coins to keep spawning if the player dies.

Yeah, depends on what OP wants to do here, the information provided is quite vague.

Also instead of rotating the coins via a script, you should use an AngularVelocity Angular Velocity | Documentation - Roblox Creator Hub

If you didn’t know already, roblox has a thing called breakpoints which are very useful in debugging code. Debugging | Documentation - Roblox Creator Hub

not sure why you would need to use physics to rotate the part, rotating them via a script is A-okay

This would not work because the coin is Anchored. Anchored parts aren’t part of the physics simulation, and applying angular velocity to the coin will have no effect.

You would have to either tween it’s rotation or connect a function to render stepped that adjusts the part’s orientation.

You can just use a rigid alignposition.

Its less laggy and also its good practice to use physics instead of a script.