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
 

Gun damages NPC in studio, but not in server.

Previous Thread :: Next Thread 
AdrianDerp1300 is not online. AdrianDerp1300
Joined: 29 Aug 2014
Total Posts: 68
13 Jul 2016 12:05 PM
I have 2 guns in my game that damage the NPCs in my game, where the humanoid part is named "Zombie" but when i go to play the game in a server it does no damage. There are a lot of errors in the output that say this "attempt to call global 'onButton1Down' (a nil value)."

Here is the part of the localscript where these errors are at which is the shooter script (the scripts are by manofthelol NOT mine, but i modified them to damage NPCs)

function onEquippedLocal(mouse)

if mouse == nil then
print("Mouse not found")
return
end

mouse.Icon = "http://www.roblox.com/asset/?id=49912389"
mouse.Button1Down:connect(function() onButton1Down(mouse) end) <----the error
mouse.KeyDown:connect(KeyDownFunctions)
while true do
wait()
end
end


Tool.Equipped:connect(onEquippedLocal)


script.Parent.Activated:connect(onActivated)
Tool.Equipped:connect(Equip)
Tool.Unequipped:connect(Unequip)
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
13 Jul 2016 12:06 PM
do you have FilteringEnabled on?
Report Abuse
AdrianDerp1300 is not online. AdrianDerp1300
Joined: 29 Aug 2014
Total Posts: 68
13 Jul 2016 12:13 PM
How do enable that?
Report Abuse
AxonMega is not online. AxonMega
Joined: 29 Aug 2014
Total Posts: 2403
13 Jul 2016 12:41 PM
It means that the function onButton1Down that you call does not exist.

--This is why we don't use free models people!
Report Abuse
AdrianDerp1300 is not online. AdrianDerp1300
Joined: 29 Aug 2014
Total Posts: 68
13 Jul 2016 01:22 PM
I use free models for complicated scripts since I'm making my first game but about the onButton1Down...do I just delete it? Or do i replace it with something else?
Report Abuse
AdrianDerp1300 is not online. AdrianDerp1300
Joined: 29 Aug 2014
Total Posts: 68
15 Jul 2016 10:32 AM
Someone please answer?
Report Abuse
AdrianDerp1300 is not online. AdrianDerp1300
Joined: 29 Aug 2014
Total Posts: 68
23 Jul 2016 11:37 PM
Problem fixed idk how
Report Abuse
tentergram is not online. tentergram
Joined: 13 Apr 2013
Total Posts: 2446
23 Jul 2016 11:42 PM
FilteringEnabled prevents localScripts from being seen to the other clients(players), It's a way to prevent exploiting, and if you want to get around that, your solution is to use remote events and remote functions to cross the client - server boundary. If a game with FilteringEnabled on has a store system, it would use remote events/functions.
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