|
| 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
|
  |
| 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 |
|
|
| |
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 08 Jul 2016 11:04 AM |
the properties of Workspace Workspace > FilteringEnabled
|
|
|
| Report Abuse |
|
|
|
| 08 Jul 2016 11:19 AM |
| Is there any good tutorial which I can use as an introduction into RemoteEvents? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 08 Jul 2016 11:44 AM |
| How do I shoot bullets using RemoteEvents? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 08 Jul 2016 12:29 PM |
| (That was directed at soy btw) |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2016 12:30 PM |
oh and btw never use mouse.hit.p use mouse.Hit.lookVector
|
|
|
| Report Abuse |
|
|
|
| 08 Jul 2016 01:07 PM |
| I am currently experimenting with RemoteEvents, but it is still impossible in a server. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2016 01:11 PM |
| IT WOORKS! FINALLY! HOORAY! YIPPIE! |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 08 Jul 2016 02:54 PM |
| Iso didn't just tell you. He wrote the damn code for you to do it! |
|
|
| Report Abuse |
|
|