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

Beginner scripter, need help??

I'm basic scripter, I don't really have knowledge of scripting names, vocabularies. On this function, I'm not sure what to add the last of function

Is it script.Parent.Changed:connect(replace)?

I'm sure Changed is normally for Values, but what about this one? Touched? Or? Please help me!! :(

function replace()
	if script.Parent.Parent.TKDoorOutside:FindFirstChild("Explosion") then
workspace.NationalAssemblyAlarm.Toggle.Value = true		
		wait(1)
		script.Parent.Parent.TKDoorOutside:Destroy()
		wait(1)
game.ServerStorage.TKDoorOutside:Clone().Parent = game.workspace
	end
end

script.Parent.Touched:connect(replace)

2 comments

1

Explain what you are trying to accomplish. What is this code that you have posted here? What does it do now? How is that different from what you want?

0

When TKDoorOutside have a child of explosion, then I want it to regen instead part touched it.

1 answer

✓ Accepted answer

This is just me personally, but instead of doing function replace()or anything, i like to do something like this:

script.Parent.touched:connect(function(replace)
--  code
end)

With this line of code, you don't have to add the last bit script.Parent.Touched:connect(replace). That is just me personally, you can do it either way. But, like what BlueTaslem said, i don't really get what you are trying to accomplish. Reading what you have given, i believe this is what you are asking, but you have to be more specific in the future. Comment back if you need more help.

2 comments

0

According to the event, what is it for cloning?

0

Thank you for not replying nor helpful.

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