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
 

Re: Easy script, but not working?

Previous Thread :: Next Thread 
domogomo is not online. domogomo
Joined: 03 Jun 2012
Total Posts: 335
04 Oct 2014 12:31 PM
So this is my script :

wait(2)
local player = game.Players.LocalPlayer
local Mouse = player:GetMouse()
local Target = Mouse.target

local Human = workspace:FindFirstChild("Humanoid")
while wait() do
if Target == Human then
Target.Humanoid.Health = 0
end
end

This is the output :
13:30:12.377 - Workspace.Part.Script:8: attempt to index local 'Target' (a nil value)
13:30:12.378 - Stack Begin
13:30:12.379 - Script 'Workspace.Part.Script', Line 8
13:30:12.380 - Stack End
Report Abuse
domogomo is not online. domogomo
Joined: 03 Jun 2012
Total Posts: 335
04 Oct 2014 12:46 PM
B
Report Abuse
BatRequiem is not online. BatRequiem
Joined: 04 Jun 2011
Total Posts: 6207
04 Oct 2014 12:48 PM
local player = game.Players.LocalPlayer
local Mouse = player:GetMouse()
local Target = Mouse.target

if Target:FindFirstChild("Humanoid") then
Target.Humanoid.Health = 0
else
return nil
end



Jesus saves. Let him in your heart!
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