|
| 11 Apr 2016 10:15 PM |
I have a script in workspace called RemoteEventInvoke and has this in it:
for i,v in pairs(game.Players:GetPlayers()) do if v:FindFirstChild("PlayerGui") then if v.PlayerGui:FindFirstChild("Inv") then v.PlayerGui.Inv.InventoryCilentInvoke:WaitForChild("InventoryOpener") v.PlayerGui.Inv.OpenInventory.MouseButton1Click:connect(function(click) v.PlayerGui.Inv.InventoryCilentInvoke.OpenInventory:FireCilent() end) end end end
There's a local script inside a GUI named Inv and locates to the local script and the remote event inside of it.
That local script contains this and is the function to open and close a inventory: script:WaitForChild("InventoryOpener") script.InventoryOpener.OnClientEvent:connect(function() if script.Parent.OpenInventory.Text == "Open Inventory" then script.Parent.OpenInventory.Text = "Close Inventory" script.Parent.InventoryFrame.Visible = true elseif script.Parent.OpenInventory.Text == "Close Inventory" then script.Parent.OpenInventory.Text = "Open Inventory" script.Parent.InventoryFrame.Visible = false end end)
-- both scripts wait for the inventoryopener remote event. -- no errors are in the output and I have tested this clearly both in online and studio mode
xloadinq 2fat4u boyeeee |
|
|
| Report Abuse |
|
|
|
| 11 Apr 2016 10:16 PM |
forgot to add in the end of the forum that:
Does anyone know why this doesn't work and has prior knowledge with using scripts and local scripts while in filtering whilst also knowing RemoteEvents?
I would greatly appreciate any answer and it would be help me with scripting in filtering.
xloadinq 2fat4u boyeeee |
|
|
| Report Abuse |
|
|
Bobbrige
|
  |
| Joined: 27 Jul 2010 |
| Total Posts: 411 |
|
|
| 11 Apr 2016 10:28 PM |
If you want to get faster and better answers, you should check this site out: https://scriptinghelpers.org/
And even though the description for the forum says not to ask for help, Scripting is full of help requests that usually don't get players banned. https://forum.roblox.com/Forum/ShowForum.aspx?ForumID=33
Unfortunately, I am too lazy to offer any input at the moment and I'm also not familiar with local scripts. |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2016 12:43 PM |
":FireCilent()"
Client*
Your problem is probably because
v.PlayerGui.Inv.InventoryCilentInvoke:WaitForChild("InventoryOpener")
The script never finds "InventoryOpener" v.PlayerGui.Inv.OpenInventory.MouseButton1Click:connect(function(click)
You can't set up a MouseButton1Click event in a server script because that event won't work as expected when you're running it on the server.
If all you're trying to do is make a GUI's visibility toggle, you don't need to use any remote events for that because only the client is going to need to see that. |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2016 04:21 PM |
i did findfirstchild and waitforchild they both dont work nor if the inventoryopener was changed to openinventory
xloadinq 2fat4u boyeeee |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2016 04:25 PM |
| PlayerGui is weird with FE. Print to see if it finds playergui and print to see if it finds what you're looking for. Use findfirstchild |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 12 Apr 2016 04:30 PM |
| Don't place RemoteEvents in players. |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2016 04:33 PM |
oh wait
Like I said don't even use a remote event for this. Just place a localscript in your frame and
If all you're trying to do is make a GUI's visibility toggle, you don't need to use any remote events for that because only the client is going to need to see that. [2] |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2016 06:31 PM |
i was just wondering and i saw a tut where the remote-event placed in startertool while working so ye
i know how 2 script!11!1 print('im hot') |
|
|
| Report Abuse |
|
|