litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 07 Aug 2015 12:52 PM |
| Then can you not use a server script with playerentered to edit a players GUIs? Do you have to do remote events and do invokeclient? |
|
|
| Report Abuse |
|
|
ByDefault
|
  |
| Joined: 25 Jul 2014 |
| Total Posts: 3197 |
|
|
| 07 Aug 2015 12:53 PM |
| I think all FilteringEnabled does is make it so the server can't edit the client and vice versa |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2015 12:55 PM |
You should use RemoteFunctions and RemoteEvents when dealing with client/server communication with FE.
This is also due to the fact that the server can't see any chances that the client does since FE prevents client-to-server replication. |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 07 Aug 2015 12:55 PM |
| Ah, so to edit the client I have to use invokeclient, correct? |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 07 Aug 2015 12:56 PM |
unless if your screengui is created via the server script, and parented to the playergui (don't do this though), then no, you won't be able to access the contents of their playergui. just do it client-sided |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 Aug 2015 12:58 PM |
"just do it client-sided"
The PlayerAdded event can't be run from the client. It has to be ran from a regular script. |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2015 01:00 PM |
| Yes but you can create the remote function from the server script when playeradded is fired and then in a local script, simply wait for child and then OnServerInvoke. |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 07 Aug 2015 01:01 PM |
-- server script
local re = game.ReplicatedStorage:WaitForChild("RemoteEvent") local yourGui = game.ServerStorage:WaitForChild("YourGui")
game.Players.PlayerAdded:connect(function(plr) re:FireClient(plr, yourGui) end)
-- local script
local re = game.ReplicatedStorage:WaitForChild("RemoteEvent")
re.OnClientEvent:connect(function(gui) gui:Clone().Parent = game.Players.LocalPlayer.PlayerGui end)
try that? |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 07 Aug 2015 01:01 PM |
""just do it client-sided"
The PlayerAdded event can't be run from the client. It has to be ran from a regular script."
i was implying that he simply clones it from replicated storage into the local player's playergui
wotevr |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2015 01:05 PM |
| Using a RemoteEvent/ RemoteFunction to communicate with the client is more efficient than constantly cloning and replacing every players GUI. |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 07 Aug 2015 01:06 PM |
| Would I be able to usde DataStores in a localscript? Just getasync, not setasync. If so I can move the script to clientside, but otherwise I need to do remote events. |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 07 Aug 2015 01:07 PM |
| you can't access datastores from a local script m8 |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2015 01:08 PM |
@lit, Datastores can only be accessed through server scripts.
You are going to have to use RemoteFunctions for that. Also, make sure you don't use a module script to do it. Modules are used from whatever is 'requiring' it. So if a localscript uses a module scripts 'GetAsync' function, it'll still run on the client and won't work. |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 07 Aug 2015 01:09 PM |
| Alright, thank you all. Its the first time I'm using filtering enabled, so I'm a total noob at it lol. |
|
|
| Report Abuse |
|
|