ive been trying make a function that call every event from a table, but it does read them, successfully find their class, but cant fire them! why??? can someone help me
the calling function:
function callEvents(name:string, state:Enum.UserInputState, info, preWindup:boolean)
for i,v:BindableFunction in ipairs(info.Event) do
print(v.Name)
if v:IsA("RemoteEvent") then
print("is remoteEvent")
v:FireServer(name, state, info, preWindup)
end
if v:IsA("BindableEvent") then
print("is bindableEvent")
v:Fire(name, state, info, preWindup)
end
if v:IsA("RemoteFunction") then
print("is remoteFunction")
local DoNotCooldown = v:InvokeServer(name, state, info, preWindup)
end
if v:IsA("BindableFunction") then
print("is bindableFunction")
local DoNotCooldown = v:Invoke(name, state, info, preWindup)
end
end
end
the listener:
local repStorage = game.ReplicatedStorage
local reconBroad = repStorage.AbilityEvents:WaitForChild("ReconBroad")
reconBroad.OnServerEvent:Connect(function(plr, name, state, info, preWindup)
print("receiving!")
end)
console logs:
22:59:11.226 activate Reconnaissance broadcast in 1 seconds! damage to deal: 7.5 - Cliente - LocalScript:146
22:59:11.226 ReconBroad - Cliente - LocalScript:95
22:59:11.226 is remoteEvent - Cliente - LocalScript:98
22:59:12.240 12 - Cliente - LocalScript:175
22:59:12.241 ReconBroad - Cliente - LocalScript:95
22:59:12.241 is remoteEvent
the event table (on a module script):
["Event"] = {game.ReplicatedStorage.AbilityEvents.ReconBroad}