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 the ice do damage in the script?

plar = game.Players.LocalPlayer
Mouse = plar:GetMouse()
char = plar.Character
charge = 0
function press(key)
	if charge >= 2 then return
		end
	key = key:lower() 
	if key == "t" then
		charge = charge + 1
		local I = Instance.new("Part")
		I.Material = "Ice"
		I.BrickColor = BrickColor.new("Medium blue")
		I.BottomSurface = "Smooth"
		I.TopSurface = "Smooth"
		I.Shape = "Cylinder"
		I.Size = Vector3.new(25, 1, 2)
		I.Transparency = .4
		I.CFrame = char.Torso.CFrame * CFrame.new(0, 0, -5)
		I.Parent = workspace
		local spin = true
		local BV = Instance.new("BodyVelocity")
		BV.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
		BV.Velocity = char.Torso.CFrame.lookVector * 40
		BV.Parent = I
		for c = 1,90 do
			I.CFrame = I.CFrame * CFrame.fromEulerAnglesXYZ(0, .3, 0)
			wait(.03)
			end
		I:Remove()
		charge = 0
		end
end
Mouse.KeyDown:connect(press)

How would I get the script to deal damage to those who hit the ice.

1 answer

✓ Accepted answer

Include

amt = 25 -- Set amount
local humanoid = plar.Parent:FindFirstChild("Humanoid") 
if (humanoid ~= nil) then	-- if a humanoid exists, then
		humanoid.Health = humanoid.Health - amt -- Using amt variable
end

Somewhere in your script.

1 comment

0

I think I got the humanoid variable wrong.

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