Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Im trying to do a prison script but ChildAdded Does not work , help?

Im trying to do a prison script and i dont want to let people get out of there so i did this , but it doesn't even work well only "running" is printed

print("running")
script.Parent.Folder.ChildAdded:Connect(function(c)
	print("child")
	wait(0.5)	
local cname = c.Name
print(cname)
	if c:IsA("StringValue") then
		while wait(3) do
			if script.Parent:FindFirstChild(cname) then
				print("yes")
				workspace[cname].Torso.CFrame = CFrame.new(script.Parent.Parent.SpawnLocation.Position)
			else
				print("broke")
				break
			end
		end
	end
end)

1 comment

0

Try this: run the game, once you see "running" has been printed out go to the folder that you included in the second line of code add a part by right clicking or something. If the rest of the script don't work then comment here.

1 answer

I was creating a string value in client mode , sorry

This discussion is preserved as it was. New answers, comments, and votes are closed.