Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Beginner scripter, need help??

Asked by
korj5 0
8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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)
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? BlueTaslem 18071 — 8y
0
When TKDoorOutside have a child of explosion, then I want it to regen instead part touched it. korj5 0 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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.

0
According to the event, what is it for cloning? korj5 0 — 8y
0
Thank you for not replying nor helpful. korj5 0 — 8y
Ad

Answer this question