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

How do I make this do damage when an enemy touches the part named "SandPool"?

--Title says it all

Player = script.Parent.Parent
Char = Player.Character
mouse = Player:GetMouse()


function keydown(key)	
	key:lower()
	if key == "v" then
		SandPool = Instance.new("Part")
		SandPool.Parent = Char["Torso"]
		SandPool.CFrame = CFrame.new(Char["Right Leg"].Position)
		SandPool.Size = Vector3.new(1,.2,1)
		SandPool.BrickColor = BrickColor.new("Daisy orange")
		SandPool.Name = "SP"
		SandPlate = Instance.new("CylinderMesh")
		SandPlate.Parent = SandPool
			game:GetService("Chat"):Chat(Player.Character.Head, "Sand Pool!")
	SandPool.Anchored = true
	Char["Right Leg"].Transparency = 1
		Char["Left Leg"].Transparency = 1

		for i = 1,10 do
			SandPool.Size = SandPool.Size+Vector3.new(3,0,3)
			wait(.1)
		end
		
		for i = 1,10 do
			SandPool.Size = SandPool.Size+Vector3.new(-3,0,-3)
			wait(.1)
		Char["Right Leg"].Transparency = 0
		Char["Left Leg"].Transparency = 0

	end
	end
	end
	

mouse.KeyDown:connect(keydown)

1 comment

1 answer

-- I put this stuff here to show just where the Sound is located
wait(34)
Song = game.Workspace.PickAToonSongs
Song.Volume = 1
Song.Looped = true


Assets = {253943659,392883743}
for _, asset in ipairs(Assets) do
game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=" .. asset)
end


Song.SoundId = "rbxassetid://" ..Assets[math.random(1,#Assets)] --'http://www.roblox.com/asset/?id=' can also be used.
Song:Play()

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