|
| 12 Apr 2016 10:25 AM |
When I fire this event, in my other server script, the part should be deleted, but it deletes the player instead. Why is that?
--Local script:
workspace.Events.ItemDelete:FireServer(part)
--Server Script
workspace.Events.ItemDelete.OnServerEvent:connect(function(item) print("part deleted "..item.Name) item:remove() end) |
|
|
| Report Abuse |
|
|
Salinas23
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 37142 |
|
|
| 12 Apr 2016 11:00 AM |
FireServer passes the player as the argument, no matter what you call it
"part" refers to your player.
workspace.Events.ItemDelete:FireServer(player, part)
-Salinas con el número 23 |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2016 11:30 AM |
| Thank you! Btw does the RemoteEvent has to be in workspace? I want to make a RemoteEvent for every player. |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 12 Apr 2016 11:30 AM |
why would you need a remoteevent for every player? you can already identify the player via the first argument. |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2016 12:02 PM |
| What if a lot of players use the same RemoteEvent? is it only one event at a time or the opposite? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 12 Apr 2016 12:03 PM |
local re = game.ReplicatedStorage:WaitForChild("RemoteEvent")
you can use any ammount of things with just one re.
|
|
|
| Report Abuse |
|
|
Salinas23
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 37142 |
|
|
| 12 Apr 2016 12:11 PM |
I use one remoteevent for all players, but just for one specific function.
-Salinas con el número 23 |
|
|
| Report Abuse |
|
|