|
| 26 Nov 2017 09:29 AM |
| what is the difference? how do i use functions and events? the wiki wasnt helping and ive watched alot of tutorials on youtube |
|
|
| Report Abuse |
|
|
|
| 26 Nov 2017 09:33 AM |
RemoteEvents and RemoteFunctions are basically custom objects for communication between the client and server (local scripts and normal scripts).
A RemoteEvent is just like any other event (onClicked, PlayerAdded, etc.), but you both fire it and connect a function to it. RemoteEvents are used to allow the client to tell the server something, or vice-versa, in a FE environment.
A RemoteFunction is a lot like a remote event, but you can get a return value from it like a normal function.
If you're having a lot of trouble, you might need to back track a bit and do some easier stuff (green tutorials).
|
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 26 Nov 2017 09:36 AM |
Watch this and you should understand it assuming you have decent knowledge of this language.
https://www.youtube.com/watch?v=4Dc_bri9mjs
|
|
|
| Report Abuse |
|
|
|
| 26 Nov 2017 09:39 AM |
@Extreme Thanks! I have one question. When I fire a remoteevent from a local script can I do it like this?
game:GetService("ReplicatedStorage").RemoteEvent.FireServer
inside a function with a normal event?
Like this:
game.Workspace.Part.Changed:Connect(function() game:GetService("ReplicatedStorage").RemoteEvent.FireServer end)
|
|
|
| Report Abuse |
|
|
|
| 26 Nov 2017 09:44 AM |
| it's game.ReplicatedStorage.RemoteEvent:FireServer() |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 Nov 2017 09:53 AM |
| I get how I use RemoteEvents atleast now, but how do I make it fire when something happens instead of firing when the server starts running? My guess is that you have to create a normal function in the localscript/serverscript and in the function you make it fire the remoteevent. Can I just do that? |
|
|
| Report Abuse |
|
|