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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: What is this error "Attempt to call nil value"?

Previous Thread :: Next Thread 
InfiniteYield is not online. InfiniteYield
Joined: 01 Mar 2012
Total Posts: 762
29 Aug 2016 08:48 PM
local mouse = player:GetMouse()
local down = false



--[[function onKeyPress4(inputObject, gameProcessedEvent)

if inputObject.KeyCode == Enum.KeyCode.D then


end
end



game:GetService("UserInputService").InputBegan:connect(onKeyPress4)]]--


mouse.Button1Down:connect(function()
down = true
--[[for i = 1,0,0.001 do
print("going")
weapon.Main.CFrame = weapon.Main.CFrame:lerp(weapon.Main.CFrame*CFrame.new(0,2,0),i)

end]]--


end)

---
error: attempt to call a nil value?
Mouse and player are defined.


Report Abuse
InfiniteYield is not online. InfiniteYield
Joined: 01 Mar 2012
Total Posts: 762
29 Aug 2016 08:50 PM
b


Report Abuse
Real_Edgy is not online. Real_Edgy
Joined: 23 Oct 2013
Total Posts: 1212
29 Aug 2016 08:51 PM
i think it's trying to tell you not to call a nil value
Report Abuse
InfiniteYield is not online. InfiniteYield
Joined: 01 Mar 2012
Total Posts: 762
29 Aug 2016 08:53 PM
Really bro.


Report Abuse
Real_Edgy is not online. Real_Edgy
Joined: 23 Oct 2013
Total Posts: 1212
29 Aug 2016 08:55 PM
yes really

but actually i can't seem to find anything wrong, other than onKeyPress4 isn't defined, but that's already long-commented
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
29 Aug 2016 08:58 PM
you are using a function that does not exist

which means the variable representing the function (for example)

print(something)

--something would be nil since it has not been declared

something()

is the same as

nil()
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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