pyxfluff
(Pyx)
February 16, 2023, 11:32pm
#1
Hello,
Randomly, my code decided to stop listening to OnServerEvent.
game.ReplicatedStorage.PSRemotes.ServerCompleted.OnServerEvent:Connect(function(PlayerLoaded, Time, ItemClass, ItemName, ModOrRegular, item)
print("test")
Not sure what’s going on. The event is made before the function is called:
local SpecialEvent =Instance.new("RemoteEvent")
SpecialEvent.Name = "ServerCompleted"
SpecialEvent.Parent = Remotes
I also tried SpecialEvent.OnServerEvent
, like it was before, and it still doesn’t work.
There’s no serverside errors, I’m 100% sure, and I even tried it via the command line and it still wont take it:
game.ReplicatedStorage.PSRemotes.ServerCompleted:FireServer(game.Players.DarkPixlz, 5, "Part", "test", false, "")
Thanks for any help, I’m clueless.
1 Like
adri200792
(adri200792)
February 16, 2023, 11:56pm
#2
There seems to be something firing the event repeatedly with no stop. Could you show the code that is firing the event?
pyxfluff:
game.ReplicatedStorage.PSRemotes.ServerCompleted.OnServerEvent:Connect(function(PlayerLoaded, Time, ItemClass, ItemName, ModOrRegular, item)
print("test")
You could try doing, game.ReplicatedStorage.PSRemotes:WaitForChild("ServerCompleted")
, it seems that you are firing to the server and the server script is not handling anything so its just cancelling the event.
1 Like
pyxfluff
(Pyx)
February 17, 2023, 12:10am
#4
Yes, it’s loading about ~7000 parts in my example but for some reaosn the script is not connecting.
There are about 400 lines inbetween when it connects and makes the event. this wouldn’t change much.
1 Like
I dont know if it’ll solve your issue but
pyxfluff:
game.ReplicatedStorage.PSRemotes.ServerCompleted:FireServer(game.Players.DarkPixlz, 5, “Part”, “test”, false, “”)
Right here, you pass through game.Players.DarkPixlz for the first variable.
pyxfluff:
game.ReplicatedStorage.PSRemotes.ServerCompleted.OnServerEvent:Connect(function(PlayerLoaded, Time, ItemClass, ItemName, ModOrRegular, item)
print("test")
And then right here you only have one player variable with roblox automatically passes through with the local player it was fired from.
1 Like
pyxfluff
(Pyx)
February 17, 2023, 12:31am
#6
That was the example I used in the command bar. This is what’s actually going through:
if not Asset:IsA("ModuleScript") then
game.ReplicatedStorage.PSRemotes.ServerCompleted:FireServer(TimeLoaded, Asset.ClassName, Asset.Name,"Other", Asset)
else
game.ReplicatedStorage.PSRemotes.ServerCompleted:FireServer(TimeLoaded, Asset.ClassName, Asset.Name, "Module", Asset)
end
1 Like
pyxfluff
(Pyx)
February 17, 2023, 2:48am
#8
I had a bit of a weird error which was making a lot of the end code unreachable and have fixed it.
2 Likes
system
(system)
Closed
March 3, 2023, 2:49am
#9
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.