Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How would I make the ice do damage in the script?

Asked by
Qiuor 20
8 years ago
01plar = game.Players.LocalPlayer
02Mouse = plar:GetMouse()
03char = plar.Character
04charge = 0
05function press(key)
06    if charge >= 2 then return
07        end
08    key = key:lower()
09    if key == "t" then
10        charge = charge + 1
11        local I = Instance.new("Part")
12        I.Material = "Ice"
13        I.BrickColor = BrickColor.new("Medium blue")
14        I.BottomSurface = "Smooth"
15        I.TopSurface = "Smooth"
View all 34 lines...

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

1 answer

Log in to vote
1
Answered by 8 years ago
Edited 8 years ago

Include

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

Somewhere in your script.

0
I think I got the humanoid variable wrong. TheUniPiggy 77 — 8y
Ad

Answer this question