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 » Scripters
Home Search
 

Re: Mouse-targeted gun script

Previous Thread :: Next Thread 
MedwedianPresident is not online. MedwedianPresident
Joined: 03 Mar 2012
Total Posts: 1351
08 Jul 2016 10:52 AM
I need a gun script that shoots a bullet at the point targeted by the mouse in a server environment. Anything that I've tried before only worked in local mode/Solo.
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
08 Jul 2016 10:53 AM
I saw your other thread on mobile when I woke up this morning.

Basically you should familiarize yourself with RemoteEvents and RemoteFunctions. Turn FE on, and from the local script, tell the SERVER to make the bullet/control the ammo/do the damage/handle the reloading, all that stuff.


Report Abuse
MedwedianPresident is not online. MedwedianPresident
Joined: 03 Mar 2012
Total Posts: 1351
08 Jul 2016 11:02 AM
How to turn FE on?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
08 Jul 2016 11:04 AM
the properties of Workspace
Workspace > FilteringEnabled



Report Abuse
MedwedianPresident is not online. MedwedianPresident
Joined: 03 Mar 2012
Total Posts: 1351
08 Jul 2016 11:19 AM
Is there any good tutorial which I can use as an introduction into RemoteEvents?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
08 Jul 2016 11:22 AM
Yes the wiki is actually instrumental at describing how to use them, HOWEVER IT DOES NOT CLARIFY ONE VERY IMPORTANT THING:

When a client fires a RemoteEvent to the server, it doesn't need to pass the player as an argument. However, the server still receives the player who sent it as the first argument.

For example, in a local script:

game.ReplicatedStorage.MyRemoteEvent:FireServer(arg1,arg2,arg3)

And the server script would receive...

game.ReplicatedStorage.MyRemoteEvent.OnServerEvent:connect(function(player,arg1,arg2,arg3)
end)

Keep that in mind, because it's either not on the Wiki or at least it wasn't when I started learning how to use them ^_^


Report Abuse
MedwedianPresident is not online. MedwedianPresident
Joined: 03 Mar 2012
Total Posts: 1351
08 Jul 2016 11:44 AM
How do I shoot bullets using RemoteEvents?
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
08 Jul 2016 11:47 AM
https://forum.roblox.com/Forum/ShowPost.aspx?PostID=190331873


here u go


- Isosta
Report Abuse
AutoCarrot is not online. AutoCarrot
Joined: 24 Oct 2013
Total Posts: 5588
08 Jul 2016 11:47 AM
Find the target your hitting on the client, send the origin and the location to the server, and make it like that
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
08 Jul 2016 12:28 PM
http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial

(example code for passing arguments through a RemoteEvent shows the player argument isn't passed)


Explanation for passing arguments through a RemoteFunction says 'When invoking a client or server an argument can be passed in. On a server invoke the player is also passed in automatically.'


I looked through the logs. It's always told the reader the player argument is passed automatically, since the page was originally created. So unless you learned it before the tutorial was made (which isn't possible) you didn't properly comprehend the tutorial.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
08 Jul 2016 12:29 PM
(That was directed at soy btw)
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
08 Jul 2016 12:30 PM
oh and btw never use mouse.hit.p
use mouse.Hit.lookVector


Report Abuse
MedwedianPresident is not online. MedwedianPresident
Joined: 03 Mar 2012
Total Posts: 1351
08 Jul 2016 01:07 PM
I am currently experimenting with RemoteEvents, but it is still impossible in a server.
Report Abuse
MedwedianPresident is not online. MedwedianPresident
Joined: 03 Mar 2012
Total Posts: 1351
08 Jul 2016 01:11 PM
IT WOORKS! FINALLY! HOORAY! YIPPIE!
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
08 Jul 2016 01:12 PM
i literally told you how to do it.


- Isosta
Report Abuse
AutoCarrot is not online. AutoCarrot
Joined: 24 Oct 2013
Total Posts: 5588
08 Jul 2016 02:54 PM
Iso didn't just tell you. He wrote the damn code for you to do it!
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