Cloning a part into workspace locally

I have a script in a part that gets cloned to Workspace. When you get the health of the part to 0, another part in Workspace is cloned to the player’s position.

I was wondering if it is possible to clone the part and only have it visible for the player who killed the part.

I tried putting the code in a LocalScript, but it did not work.


function Dead() 
local Humanoid = script.Parent.Humanoid
local tag = Humanoid:findFirstChild("creator") 
if tag ~= nil then 
if tag.Value ~= nil then 
local Part = game.Workspace.Folder.Part:Clone()
Part.Position = script.Parent.HumanoidRootPart.Position
Part.Anchored = false
Part.Parent = game.Workspace.Folder

Where is your local script parented to? A local script has to be a descendant of the LocalPlayer, in order to run its code.

Reiterating what @EmeraldLimes said local scriptings has to be a descendant of the LocalPlayer. You have your script in the part. What you should do is deal with this stuff in PlayerScripts or make the parts on the server and make them transparent and on a local script in player scrips make them visible

This script should work unless it is put in the sss or the server storage.

It won’t work since its a local script. server storage and sss are meant for server side stuff.

Can’t you just put it in starter player scripts and it will work?

@Elite_Remote Yes you can put it in starter player script.