User talk:Lolzy: Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>Lolzy No edit summary |
>JustinP231 Drowning |
||
Line 1: | Line 1: | ||
==Place All Comments Below Here== | ==Place All Comments Below Here== | ||
== Drowning == | |||
Drowning isn't actually very difficult. Try this script. =D | |||
local XX = script.Parent.Position.x - (script.Parent.Size.x /2) | |||
local Xx = XX * -1 | |||
local YY = script.Parent.Position.y - (script.Parent.Size.y / 2) | |||
local Yy = YY * -1 | |||
local ZZ = script.Parent.Position.z - (script.Parent.Size.z /2) | |||
local Zz = ZZ * -1 | |||
local Drown = 2 -- How often they will take damage if underwater (in seconds). | |||
local damage = 10 -- How much damage they receive each time. | |||
while true do | |||
wait(Drown) | |||
local P = game.Players:GetChildren() | |||
for i = 1, #P do | |||
if P[i].Character:findFirstChild("Head") ~= nil then | |||
local X = P[i].Character.Head.Position.x | |||
local Y = P[i].Character.Position.y | |||
if X > XX and X < Xx then | |||
if Y > YY and Y < Yy then | |||
P[i].Character.Humanoid.Health = P[i].Character.Humanoid.Health - damage | |||
end | |||
end | |||
end | |||
end | |||
end | |||
Okay... Maybe that wasn't so simple... Ah well. Place that into a water brick. But, it probably won't work if you rotate or tilt the brick, so don't do it! Test it for me and lemme know if it works... --[[User:JustinP231|JustinP231]] 01:05, 4 April 2008 (CDT) |
Revision as of 06:05, 4 April 2008
Place All Comments Below Here
Drowning
Drowning isn't actually very difficult. Try this script. =D
local XX = script.Parent.Position.x - (script.Parent.Size.x /2) local Xx = XX * -1 local YY = script.Parent.Position.y - (script.Parent.Size.y / 2) local Yy = YY * -1 local ZZ = script.Parent.Position.z - (script.Parent.Size.z /2) local Zz = ZZ * -1 local Drown = 2 -- How often they will take damage if underwater (in seconds). local damage = 10 -- How much damage they receive each time. while true do wait(Drown) local P = game.Players:GetChildren() for i = 1, #P do if P[i].Character:findFirstChild("Head") ~= nil then local X = P[i].Character.Head.Position.x local Y = P[i].Character.Position.y if X > XX and X < Xx then if Y > YY and Y < Yy then P[i].Character.Humanoid.Health = P[i].Character.Humanoid.Health - damage end end end end end
Okay... Maybe that wasn't so simple... Ah well. Place that into a water brick. But, it probably won't work if you rotate or tilt the brick, so don't do it! Test it for me and lemme know if it works... --JustinP231 01:05, 4 April 2008 (CDT)