I’m working on a racing system, and I’ve encountered an issue.
The RequestJoin
RemoteEvent does not seem to be received by the server. The fired
print is printed, but the received
print is never printed so I assume the event was never received. Why is the event not being received? Anyone know what’s going on?
RaceManager (Server)
local people = {}
local ppl = 0
while task.wait() do
wait(15)
game.ReplicatedStorage.Remotes.ShowRace:FireAllClients()
print("message sent")
active = true
wait(15)
active = false
--important part past here
print(ppl.." people")
if ppl > 0 then
for i,v in pairs(people) do
if game.Players:FindFirstChild(v) then
print("finding cars")
local char = v.Character
local hum = char.Humanoid
local seat = hum.SeatPart
if string.find(seat.Parent.Name, "Racecar") then
local car = seat.Parent
print("finished")
end
end
end
end
end
game.ReplicatedStorage.Remotes.RequestJoin.OnServerEvent:Connect(function(plr)
print("received") --not printing
print(plr.Name)
if not table.find(people, plr.Name) and ppl < 5 and active == true then
print("requirements met")
ppl = ppl + 1
end
end)
RaceManagerClient (Client)
script.Parent.TextButton.MouseButton1Click:Connect(function()
local char = game.Players.LocalPlayer.Character
local hum = char.Humanoid
if hum.Sit == true and hum.SeatPart ~= nil then
print("sit")
game.ReplicatedStorage.Remotes.RequestJoin:FireServer()
print("fired")
end
end)
game.ReplicatedStorage.Remotes.ShowRace.OnClientEvent:Connect(function()
script.Parent.TextLabel.Visible = true
script.Parent.TextLabel2.Visible = true
script.Parent.TextButton.Visible = true
print(2)
for i = 1,10 do
script.Parent.TextLabel.Text = "Race starting in "..10-i.." seconds"
wait(1)
end
script.Parent.TextLabel.Text = "Configuring.."
print(3)
end)