#triying make flash flood
15 messages · Page 1 of 1 (latest)
script.Parent.Touched:Connect(function(hit)
if hit and hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 10
end
end)
I have this script but I would like it to do damage within the area
try this one:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid:TakeDamage(10)
end
end)
the water is a part right?
** You are now Level 2! **
local Terrain = workspace.Terrain
--lava color
Terrain.WaterColor = Color3.fromRGB(255, 100, 0)
local material = Enum.Material.Water
--position and start size of lava(position Y is basically the floor under the lava)
local start_pos = CFrame.new(0, 0, 0)
local start_siz = Vector3.new(100, 20, 100)
--the bigger speed is, the faster lava rises
local speed = 10000
--end height in studs
local end_height = 500
--apply math to convert position center to position floor for Y
start_pos = CFrame.new(start_pos.X, start_pos.Y+start_siz.Y/2, start_pos.Z)
Terrain:FillBlock(start_pos, start_siz, material)
--lava animation
local position = start_pos
local size = start_siz
for i = size.Y/2, end_height, 1 do
size = Vector3.new(size.X, 1, size.Z)
position = CFrame.new(position.X, position.Y+1, position.Z)
Terrain:FillBlock(position, size, material)
task.wait(1/speed)
end
task.wait(10) --where 10 is the round length
--erase lava
local end_pos = CFrame.new(start_pos.X, start_pos.Y+(end_height-start_siz.Y)/2, start_pos.Z)
local end_siz = Vector3.new(start_siz.X, start_siz.Y/2+end_height, start_siz.Z)
Terrain:FillBlock(end_pos, end_siz, Enum.Material.Air)
that's water but it doesn't hurt the players
does it rise?