Currently I’m trying to only render abilities and stuff on specific clients. This is the code that I’m having trouble with (I’m putting it here so you can look back as I explain):
local repStorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local brRemotes = repStorage:WaitForChild("BattleRelatedRemotes")
local modules = repStorage:WaitForChild("Modules")
local attackRemote = brRemotes:WaitForChild("AttackRemote")
local battleModule = require(modules:WaitForChild("ClientBattleModule"))
attackRemote.OnClientEvent:Connect(function(attacker, ability, hit, target, camLook)
print("Signal received.")
battleModule:RenderAbility(attacker, ability, hit, target, camLook)
end)
attackRemote.OnClientEvent:Connect(function() print("Hey!") end)
print(attackRemote.Name)
I have breakpoints on each un-indented line after “local
modules
”, but the last three don’t stop the script at all. The events do not connect and of course the print at the very end doesn’t run. My watch shows that all variables from before the events have been correctly assigned. Anybody have any idea what I’ve done wrong?
Edit: On further testing I’ve realised that the script stops running after:
“local
battleModule = require(modules:WaitForChild("ClientBattleModule"))
”
I’m now even more confused because I’ve triple checked that it’s pointing to the correct directory, and the module is already there when the script stops on this line’s breakpoint.