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

How would I make different parts change when a player touches something?

When a player touches a part, I want other parts to change.

I'm not trying to change the transparency, color, or whether or not the part is anchored, I'm trying to make the parts change completely into for example multiple wedges.

I know one of the first lines of the script is:

game.Workspace.PARTNAME.Touched:Connect(function()

1 comment

0

Have your parts assigned a particular name that your script will look for and just do a game.Workspace.PARTNAME really. Not sure what exactly you're asking for since your question doesn't elaborate all that much.

1 answer

✓ Accepted answer

No fear I am here!

hum = workspace.ChildAdded:Connect(function(child)
if child:IsA("Model") and child.Humanoid then return child end
end)

connection = hum.Touched:Connect(function(part)
if part:IsA("BasePart") and part.CanCollide == true then
part.Shape = math.random(0,2) -- a ball, cylinder, block etc.
else return false
end
end)

-- you may want to disconnect after you're done ;)

This simply generates random part types when you touch other parts.

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