Sleitnick / AeroGameFramework

AeroGameFramework is a Roblox game framework that makes development easy and fun. The framework is designed to simplify the communication between modules and seamlessly bridge the gap between the server and client.
https://sleitnick.github.io/AeroGameFramework/
MIT License
216 stars 57 forks source link

RegisterClientEvent Not Working [solved] #108

Closed LukeGabrieI closed 4 years ago

LukeGabrieI commented 4 years ago

This could be temporary, but every time I try making a RemoteEvent using RegisterClientEvent, it does not work. Please fix, thanks.

Sleitnick commented 4 years ago

Can you provide some examples to reproduce this issue?

LukeGabrieI commented 4 years ago

Server-Script: https://pastebin.com/5swRZiqj

So, basically what I'm trying to do is create a RemoteEvent which will then be fired to the client. I put the function as a shared function just so that the later module script function thingy (BallModule:AttemptParent()) would make the event work. Regardless, this is where the [Module](Screenshot from Gyazo) is located, and this is how I require the [Module](Screenshot from Gyazo).

I'm also getting this yielding error here, I dont know why. [](Screenshot from Gyazo)

Sleitnick commented 4 years ago

Your tool shouldn't be explicitly requiring any modules for the framework. If you're accessing framework modules from the server, use _G.AeroServer instead. For instance, to reference the Ball Service:

while not _G.AeroServer do wait() end -- Wait for framework initialization if needed
local BallService = _G.AeroServer.Services.BallModule

However, the actual issue you're having is in regards to the top section of your Ball Service module. You reference local Tool = script.Parent.Parent.Parent, which in this context would just equal the ServerStorage object, not a tool. However, then you try to wait for objects like local ToolValues = Tool:WaitForChild("Values"), but that probably doesn't exist in ServerStorage, thus it waits forever.

LukeGabrieI commented 4 years ago

Okay, thank you so much for your help. I'm transitioning into using modules for my game now and I'm really glad that you made tutorials for your own framework. Keep up the good work!

LukeGabrieI commented 4 years ago

I actually had the ball module in the tool at the beginning, but now that I can access it from server storage, I'm going to redo the coding for it. Screenshot from Gyazo

Sleitnick commented 4 years ago

Cool, glad you got it to work!