Now I'm sure that this might have been answered before but this is my first day learning FE, so try to make it simple :P
So I watched Alvinblox's tutorial on Remote Events, I copied it exactly how he did it and it worked. I then decided to try it with a Surface Gui - I did everything the same as I should do; but I got no results.
Apparantly RemoteEvents only work on ScreenGuis??? (Obviously not)
LocalScript:
script.Parent.MouseButton1Click:Connect(function() game.ReplicatedStorage.RemoteEvent:FireServer() end)
Script:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function() print("oof") end)
This depends on if you are handling the SurfaceGui
locally or not. For example, if you put a SurfaceGui
directly onto a part and then tried to use a LocalScript
with remote firing, it would probably not work as the SurfaceGui
would be handled on the server rather than the client.
So, if you want to handle a SurfaceGui
locally, you would simply place the SurfaceGui
into StarterGui
and make a script that sets the Adornee
property of the GUI to the part that you want it displayed on. This way, the SurfaceGui
is in the client and is being watched by the client. Then, your code should work.
That may sound confusing, so here's some other wiki articles that could help get you going. If you have any other questions, feel free to contact me on Discord joritochip#4657
.
http://wiki.roblox.com/index.php?title=Experimental_Mode
http://wiki.roblox.com/index.php?title=API:Class/SurfaceGui
http://wiki.roblox.com/index.php?title=The_Fundamentals_of_Scripting_with_GUIs
If I helped you out, please leave an upvote! If I solved your solution, please mark my reply as the post's solution. This allows future visitors to see the correct solution. Thanks!