|
| 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 |
|
|
|
| 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 |
|
|
|
| 27 Jun 2014 09:21 PM |
| Yes but I think there is a better way to do it. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
| |
|
| |
|
| |
|
| |
|
|
| 28 Jun 2014 09:40 AM |
| Well the roblox rocket launcher does so yes you do. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 28 Jun 2014 07:28 PM |
| That's from a tool, it's not the same thing. Stop bumping. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 28 Jun 2014 07:37 PM |
| I tried looking at it and could not understand it and weapons are tools smart one. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 28 Jun 2014 07:51 PM |
| And using a LocalScript is not an option because it is too exploitable. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|