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

Player destroying blocks?

I am making a Giant, Godzilla game and I had one question. How can I make it so I can stomp on bricks? Thank you.

2 answers

✓ Accepted answer

Use the Touched event on the legs and make it explode the part you touched. Example:

--leg is a part
leg.Touched:connect(function(oPart)
splode = Instance.new("Explosion", oPart)

end)

3 comments

0

I'm sorry I am a beginner, but do I have to replace leg with right leg or something?

1

yup, like game.Workspace.Godzilla.RightLeg or whatever it is

0

Thank you!

If you actually want to 'destroy' the blocks, I'd do something like this-

local Godzilla = Workspace.Godzilla -- Location of your Godzilla model

function BodyTouch(part)
	-- Code your method of 'destroying parts' here
	part.Anchored = false
	part:BreakJoints()
end

for _, obj in pairs(Godzilla:GetChildren()) do
	if obj:IsA("BasePart") then
		obj.Touched:connect(BodyTouch)
	end
end

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