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

Whats wrong with this script?

Asked by
jobruin 10
10 years ago
function joel(hit)

    hit.Transparency = 1

end

script.Parent.Touched:connect(joel)

wait(5)

game.Workspace.Part:Clone()


function og(sup)
    wait(5)

    sup.Transparency = 0

    script.Parent.Touched:connect(og)
end

So what I want it to do is if something hits the brick it goes transparent first. Second it clones the same brick than the brick that is cloned gets touched by something it will change it's transparent to 0

2 answers

Log in to vote
-1
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
10 years ago
script.Parent.Touched:connect(function(hit)
hit.Transparency = 1
wait(5)
clne = script.Parent:Clone()
clne.Parent = game.Workspace
clne.Touched:connect(function(hitt)
hitt.Transparency = 0
end) end)

This would do what you're asking, what you were doing was specifying the connection statement before you ended the function..

script.Parent.Touched:connect(og)
end

Hope it helped

0
Can you explain to me why its clne? jobruin 10 — 10y
0
As in 'Clone' but without the 'o' ~ clne which represents the clone of the script's Parent Goulstem 8144 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

You need to call the function after the end. Not before it.

Answer this question