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

Whats wrong with this script?

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

✓ Accepted answer
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

2 comments

0

Can you explain to me why its clne?

0

As in 'Clone' but without the 'o' ~ clne which represents the clone of the script's Parent

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

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