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.
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.