when I fire a event, the server doesn’t recieve it!
client code:
wait(7)
game.ReplicatedStorage.Events.StartEvent.OnClientEvent:Connect(function()
print("started")
script.Parent.Frame.Visible = true
script.Parent.Value.Value = true
wait(10)
script.Parent.Frame.Visible = false
script.Parent.Value.Value = false
end)
script.Parent.Frame.TextButton.MouseButton1Click:Connect(function()
if script.Parent.Value.Value == true then
script.Parent.Frame.Visible = false
script.Parent.Value.Value = false
game.ReplicatedStorage.Events.EnterPlayer:FireServer()
end
end)
server code:
game.ReplicatedStorage.Events.EnterPlayer.OnServerEvent:Connect(function(plr)
print(plr)
table.insert(plrs,plr.Name)
game.Workspace.Obby.End.Touched:Connect(function(h)
if h.Parent and h:FindFirstChild("Humanoid") then
local winner = game.Players:GetPlayerFromCharacter(h.Parent)
winner.leaderstats.Kimchi += 1500
workspace.Obby.Barrier.Transparency = 0.5
workspace.Obby.Barrier.CanCollide = true
for index,value in ipairs(plrs) do
if game.Players[value] then
game.Players[value].Character.Humanoid.Health = 0
end
end
end
end)
end)