
Untitled
By: a guest on
Apr 15th, 2012 | syntax:
Lua | size: 1.46 KB | hits: 13 | expires: Never
game.Workspace.ChildAdded:connect(function(child)
if child.Name ~= "Ray" then
for _,v in pairs(game.Workspace:GetChildren()) do
if v:FindFirstChild("Humanoid") and v:FindFirstChild("Head") and v:FindFirstChild("Torso") and v:IsA("Model") then
function CastRay(bool,color,tran,collidebool)
while bool do
wait(0.25)
if (v.Torso.Position - game.Workspace.Raycaster.RayPart.Position).magnitude <= 50 or v.Name ~= "TigreBlood" then
local Ray = Ray.new(game.Workspace.Raycaster.RayPart.Position,(v.Torso.Position - game.Workspace.Raycaster.RayPart.Position).unit * 400)
local Hit,Position = game.Workspace:FindPartOnRay(Ray,game.Workspace.Raycaster.RayPart)
if Hit then
if Hit.Parent:FindFirstChild("Humanoid") then
Hit.Parent.Humanoid:TakeDamage(math.random(1,5))
end end
Raylol = Instance.new("Part")
Raylol.Parent = workspace.Raycaster
Raylol.Anchored = true
Raylol.CanCollide = collidebool
Raylol.Transparency = tran
Raylol.BrickColor = BrickColor.new(color)
Raylol.Locked = true
Raylol.formFactor = "Custom"
Raylol.BottomSurface = "Smooth"
Raylol.TopSurface = "Smooth"
Raylol.Name = "Ray"
local Distance = (Position - game.Workspace.Raycaster.RayPart.Position).magnitude
Raylol.Size = Vector3.new(0.2,0.2,Distance)
Raylol.CFrame = CFrame.new(Position,game.Workspace.Raycaster.RayPart.Position) * CFrame.new(0,0,-Distance/2)
game:GetService("Debris"):AddItem(Raylol,0.1)
end end end
wait()
CastRay(true,"Bright yellow",0,false)
wait(0.25)
end end end end)