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: Gun Help

Previous Thread :: Next Thread 
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
27 Jun 2014 09:02 PM
When firing a weapon from a server script how would you get the position of the users mouse?
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
27 Jun 2014 09:15 PM
You could use a local script inside the backpack to update a value somewhere else that holds the mouse's position
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
27 Jun 2014 09:21 PM
Yes but I think there is a better way to do it.
Report Abuse
PerpetualMovement is not online. PerpetualMovement
Joined: 04 Dec 2012
Total Posts: 1001
27 Jun 2014 09:26 PM
script.Parent.Equipped:connect(function(mouse) --have this LocalScript inside a Tool
for i = 1, 10, 1 do --print the mouse's location 10 times
wait(1)
print(mouse.X, mouse.Y)
end
end)

This was edited from the Wiki, you can only get the mouse from LocalScripts.

http://wiki.roblox.com/index.php?title=Mouse
"This item should be used with a LocalScript in order to work as expected in online mode."
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
27 Jun 2014 09:31 PM
Bump
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
27 Jun 2014 09:37 PM
Well if you tried using something along the lines of
while wait() do
for c,v in pairs(game.Players:GetChildren()) do
if v.Name == "PlayerNameHere" then
Mouse = v:GetMouse()
print("LocationCoordinatesHere")
end
end
end
It should work.
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
27 Jun 2014 10:21 PM
Bump
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
27 Jun 2014 10:37 PM
Bump
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
27 Jun 2014 11:29 PM
Bump
Report Abuse
BalisticMissile is not online. BalisticMissile
Joined: 05 Mar 2009
Total Posts: 282
27 Jun 2014 11:47 PM
You don't. Stop bumping.
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
28 Jun 2014 09:40 AM
Well the roblox rocket launcher does so yes you do.
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
28 Jun 2014 10:27 AM
Bump
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
28 Jun 2014 11:16 AM
Bump
Report Abuse
BalisticMissile is not online. BalisticMissile
Joined: 05 Mar 2009
Total Posts: 282
28 Jun 2014 07:28 PM
That's from a tool, it's not the same thing. Stop bumping.
Report Abuse
BalisticMissile is not online. BalisticMissile
Joined: 05 Mar 2009
Total Posts: 282
28 Jun 2014 07:30 PM
But if that's the case, why didn't you just look at the ROBLOX rocket? It's pointless for you to be here. From what I see in the script you get the Humanoid's TargetPoint.
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
28 Jun 2014 07:37 PM
I tried looking at it and could not understand it and weapons are tools smart one.
Report Abuse
BalisticMissile is not online. BalisticMissile
Joined: 05 Mar 2009
Total Posts: 282
28 Jun 2014 07:40 PM
#1 Learn to respect. I told you how to do it which can only be accessed by a normal script inside of a tool. This is not considered an action by the server, since a server script cannot get this same target position from the humanoid as a tool can. It's a clientside action only.
Report Abuse
BalisticMissile is not online. BalisticMissile
Joined: 05 Mar 2009
Total Posts: 282
28 Jun 2014 07:41 PM
Just use a localscript or use a normal script from a tool and get the Humanoid TargetPoint. Btw you don't need a tool to make a weapon.
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
28 Jun 2014 07:50 PM
TargetPoint is not where they are aiming and almost all games on roblox use Tools for weapons.
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
28 Jun 2014 07:51 PM
And using a LocalScript is not an option because it is too exploitable.
Report Abuse
BalisticMissile is not online. BalisticMissile
Joined: 05 Mar 2009
Total Posts: 282
29 Jun 2014 03:39 AM
Ok when you retrieve the TargetPoint from a normal script in a tool. It returns where they're aiming. Look at the ROBLOX Rocket Launcher script near the end.
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