I have a problem why is my Bindable event not receiving message from the ModuleScripts ?
ModuleScript :
function VoteSystem:GetMap()
self.votes = {}
for i, map in ReplicatedStorage.Maps:GetChildren() do
self.votes[map.Name] = {}
end
self:GetVoteTally()
self:Countdown(self.intermission)
local mapName = self:GetVoteTally()
local mapObject
if mapName and ReplicatedStorage.Maps:FindFirstChild(mapName) then
mapObject = ReplicatedStorage.Maps[mapName]:Clone()
else
local maps = ReplicatedStorage.Maps:GetChildren()
local randomMap = maps[math.random(#maps)]
mapObject = randomMap:Clone()
end
mapObject.Parent = workspace
MatchStarted:Fire("Test Message")
print("TESS MESSAGE SENT")
return mapObject
end
ServerScript
MatchStart.Event:Connect(function(message)
print("MESSAGE RECEIVE IS : ", message)
end)
local Match = Events:WaitForChild("Match")
local MatchStart = Match:WaitForChild("MatchStarted")
VotingManager:GetMap()
-- Function to handle match start (only called once, no spam)
local function handleMatchStart(player, modeChoosen)
-- Only allow match start if no match is already running
print("MATCH SHOULD START")
if not connectionDebounce then
connectionDebounce = true -- Set debounce to true to block further match starts
-- Start the appropriate game mode based on the chosen mode
if string.find(modeChoosen, "color") then
ColorManager:startGame(modeChoosen)
elseif string.find(modeChoosen, "Celebrity") then
CelebrityManager:startGame(modeChoosen)
elseif string.find(modeChoosen, "Cannon") then
CanonManager:startGame(modeChoosen)
elseif string.find(modeChoosen, "Parkour") then
ParkourManager:startGame(modeChoosen)
else
FallManager:startGame(modeChoosen)
end
else
warn("Match already in progress, ignoring extra start requests.")
end
end
-- Function to handle match end (called once when the match ends)
local function handleMatchEnd(player)
if connectionDebounce then
connectionDebounce = false -- Reset debounce to allow new matches
-- Clean up the current map
for _, v in ipairs(game.Workspace:GetChildren()) do
if string.find(v.Name, " Mode") or string.find(v.Name, "color") then
v:Destroy()
end
end
-- Restart voting session for the next match
else
warn("No match in progress, ignoring end requests.")
end
end
MatchStart.Event:Connect(function(message)
print("MESSAGE RECEIVE IS : ", message)
end)