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

how to make a new instance damage player and/or have a script in it?

well, you see, when you make a new instance, it's just a plain old brick or whatever you made the new instance of. which led me to the question, how could I make it so that the instance damages people/have its own script? like always, I wish to learn.

1 answer

✓ Accepted answer

Is this what you're looking for?

local brick = Instance.new("Part")

brick.Parent = workspace

brick.Touched:Connect(function(toucher)
	local human = toucher.Parent:FindFirstChild("Humanoid")
	local damage = 42

	if human then
		human:TakeDamage(damage)
	end
end

1 comment

0

thanks.

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