|
| 13 Jul 2016 02:02 PM |
for remote events?
hi i steal usernames |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2016 02:03 PM |
http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial
( ͡• ◡ ͡•) -=[ RAP: 358,184 || DurstAuric; the narb of ROBLOX ]=- ( ͡• ◡ ͡•) |
|
|
| Report Abuse |
|
|
Fangous
|
  |
| Joined: 03 Jul 2010 |
| Total Posts: 4448 |
|
|
| 13 Jul 2016 02:03 PM |
| https://www.youtube.com/watch?v=C0qQ4lDa3t0 |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2016 02:04 PM |
durst
the wiki is like confusing for me these days but thanks though
hi i steal usernames |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 13 Jul 2016 02:25 PM |
yeah wiki is pretty cancerous with res. Anyways, here is the basic idea
Filtering Enabled prevents the client from talking directly to the server or rather, prevents client changes from replicating to the server. What this means is that if a person decides to change something in the workspace or something with a local script, the other players in the server will not see this change. A workaround for this are remote events/functions.
Remote Events and Remote Functions allows the client to 'talk' to the server. They are similar but have their differences. Remote Events will not make the script yield with a call. Remote Functions on the other hand will yield the script until a value is returned. I will mainly be discussing Remote Events since there are only a few occasions where you will really need to use Remote Functions.
Now, note that it is good practice to store Remote Events in Replicated storage, ie
game.ReplicatedStorage:WaitForChild('RemoteEvent')
If you looked on the wiki, you will find two properties of the RE that are important with communicating between the client and server.
re:FireClient(plr,...) --fires a client with data re:FireAllClients(...) --will fire data to all the clients in the server with data re:FireServer(...) --fires the server with data
I will show you a basic layout of using the above.
--server script
local re = game.ReplicatedStorage:WaitForChild('RemoteEvent')
re.OnServerEvent:connect(function(plr,arg1) --note plr will always be first arg print(plr.Name,arg1) re:FireClient(plr,'Hello!') --sendw the message to a specified player end)
--local script
local re = game.ReplicatedStorage:WaitForChild('RemoteEvent')
re:FireServer('Hi!') --send the string 'hi' to the server
re.OnClientEvent:connect(function(arg1) --recieved from server print(arg1) end)
Output: Player1 Hi! Hello!
What you have essentially done is send the strings 'hi' and 'hello' to the server and client. You can send anything to the server. Even user data, but that is generally bad practice.
Anyways, with RemoteEvents you can use them even without FE. They are extreemly useful for communication.
There are a couple of restrictions that come with FE and Remote Events but one that is very important is the fact that you can not directly access the PlayerGui with FE. You will need to use remote Events. If you have any questions regarding FE or Remote Events, contact me on here or send me a message.
--TimeTicks
|
|
|
| Report Abuse |
|
|
|
| 13 Jul 2016 02:28 PM |
@Time
where do you put the server script and local script?
do you put them in anywhere?
hi i steal usernames |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 13 Jul 2016 02:42 PM |
The serverscript can be in workspace or serverscriptservice. I suggest serverscriptservice
the local script can be inside the playergui,backpack, or starterplayerscritps
|
|
|
| Report Abuse |
|
|
|
| 13 Jul 2016 02:43 PM |
ah i see
thanks
hi i steal usernames |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2016 07:30 PM |
https://www.youtube.com/playlist?list=PLatbVFCcsDB9JZE_1WQvmG0i4NrpNIybs
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2016 05:55 PM |
| I don't get that at all.I need a video. |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2016 06:37 PM |
I gave you some videos.
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Aug 2016 10:10 PM |
lol
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2016 10:42 PM |
| why are you guys posting on a thread that's dead |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 04 Aug 2016 03:20 PM |
its not dead until i say so
|
|
|
| Report Abuse |
|
|
|
| 04 Aug 2016 04:26 PM |
bump of life
Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx |
|
|
| Report Abuse |
|
|
|
| 04 Aug 2016 04:38 PM |
bump of life[2]
blobfish are going to be bricks for my wall; tardigrades are going to be the glue for my wall |
|
|
| Report Abuse |
|
|
Lecturous
|
  |
| Joined: 17 Aug 2013 |
| Total Posts: 1096 |
|
| |
|
|
| 05 Aug 2016 09:37 AM |
| "blobfish are going to be bricks for my wall; tardigrades are going to be the glue for my wall"...? |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2016 01:30 PM |
@Shikas That's his signature.
( ͡• ◡ ͡•) -=[ RAP: 375,516 || DurstAuric; the narb of ROBLOX ]=- ( ͡• ◡ ͡•) |
|
|
| Report Abuse |
|
|
|
| 06 Aug 2016 12:30 AM |
| I know but why do people do that it's pointless.... you do it too. We can read it the first time.. |
|
|
| Report Abuse |
|
|
|
| 06 Aug 2016 07:54 AM |
"We can read it the first time.."
im sorry but did you even think while typing that post
blobfish are going to be bricks for my wall; tardigrades are going to be the glue for my wall |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Aug 2016 04:58 PM |
"we" you mean *you*
blobfish are going to be bricks for my wall; tardigrades are going to be the glue for my wall |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2016 05:10 PM |
| Wow :P You wasted my time to tell me that.. |
|
|
| Report Abuse |
|
|