Why Dont My Scripts Work When They Are From ReplicatedStorage?

It works outside of the replicated storage, like if the orignial was just in workspace at the begining

can u just give us a sample of your code?

I have the script part working, its just that it doesnt work after being cloned. if it was already in the workspace it wouldnt work either

then it must be a problem with the script itself

Sure

function onTouched(part)
 	local h = part.Parent:findFirstChild("Humanoid")
 		if h~=nil then
  			h.Health = h.Health-100
		 end
	end
script.Parent.Touched:connect(onTouched)

exactly what im saying… we need to see it

do you parent this script to the kill brick ? or to the workspace

1 Like

to the kill brick. The entire obby is in the workspace

what do u use to parent it? collection service? or a FOR

so then what’s the problem ? if you clone it and parent it to kill bricks it should work

it works outside of replicated, like if it was orignally in workspace, and it wasnt a clone.

i have anouther thing that has a script which is a tp block, and when you interact with it, it doesnt work, but the one that is still in workspace does

Guys, Im sure that its just because its not in the right place. Maybe instead of replicated storage I put it somewhere else

i just tested it and it works. Make sure you both clone and parent with a server script.

replicatedstorage.Script:Clone().Parent = workspace.Brick

Make sure the scripts are enabled.

also just fyi not what u wanted but id suggest to use

function onTouched(part)
 	local h = part.Parent:findFirstChild("Humanoid")
 		if h then
  			h.Health = 0
		 end
	end
script.Parent.Touched:connect(onTouched)

neatens it up and makes sure an exploiter with inf health will still die

No, I am helping him and he is cloning the obby and putting it in workspace, and we will add multiple obbies.

I just tested, and when it clones, the script still remains in the part

i’ve gotta go but i hope u fix your problem!

1 Like

it’s hard to help when i have absolutely no idea what you’re trying to reach ngl. you’re trying to clone a obby ?