generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Not sure why it isnt working

Previous Thread :: Next Thread 
soccaboy17 is not online. soccaboy17
Joined: 22 Sep 2009
Total Posts: 3161
07 Jul 2012 09:37 PM
while true do
g = game.Players:GetChildren()
for i = 1, #g do
mag = (script.Parent.Center.Position – g[i].Character.Torso.Position).magnitude
if mag < 200 then
local ray = Ray.new(
script.Parent.Center.p,
(g[i].Character.Torso – script.Parent.Center.p).unit * 200
)
local gun = script.Parent.Center
local Hit,Position = game.Workspace:FindPartOnRay(ray,gun)
if Hit then
if Hit.Parent:FindFirstChild("Humanoid") then
if game.Players:GetPlayerFromCharacter(Hit.Parent)== g[i] then
Hit.Parent.Humanoid:TakeDamage(30)
end
end
end
end
end
wait()
end
Report Abuse
NinjaShadow1 is not online. NinjaShadow1
Joined: 03 Mar 2009
Total Posts: 2689
07 Jul 2012 09:39 PM
script.Parent.Center.CFrame.p

I'll look for more problems
Report Abuse
soccaboy17 is not online. soccaboy17
Joined: 22 Sep 2009
Total Posts: 3161
07 Jul 2012 09:40 PM
Oops, my bad. Okay thanks.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image