luketeam5
(luketeam5)
November 21, 2020, 6:56pm
1
Hello, recently my remote events stopped working, any idea why?
Simplyfied version of script (Original is longer)
Server Script
script.Parent.RemoteEvent.OnServerEvent:Connect(function()
script.Parent:Destroy()
end)
Local Script
script.Parent.ClickDetector.MouseClick:Connect(function()
script.Parent.RemoteEvent:FireServer()
end)
Part where scripts are located
Thanks for any help
Localscripts don’t work when they are a descendant of Workspace and not parented by a character model at the same time.
Plus, you can detect ClickDetector.MouseClick event from serverscript so you don’t even have to bother with remotes.
luketeam5
(luketeam5)
November 21, 2020, 7:03pm
3
Plus, you can detect ClickDetector.MouseClick event from serverscript so you don’t even have to bother with remotes.
I’m using this as example, i have same problem in PlayerGuis and workspace
It should work under PlayerGUI though.
But looking at your instance tree yours is definitely is a descendant of workspace and not parented by a character model so it’s not gonna execute any code
luketeam5
(luketeam5)
November 21, 2020, 7:14pm
5
This is local script in playergui
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.Examples.Remotes.Request:FireServer()
end)
Server
game.ReplicatedStorage.Examples.Remotes.Request.OnServerEvent:Connect(function(plr)
print("Event")
end)
Edit: No errors in console
It worked fine for me without any errors though.
luketeam5
(luketeam5)
November 21, 2020, 7:19pm
7
It doesn’t work for me, can you send me your entire model?
Contents of the script scripts are exactly the same with yours.
luketeam5
(luketeam5)
November 21, 2020, 7:25pm
9
Interesting, it doesn’t work for me… However on different place it works
Soo i guess it’s just a glitch and i wasted 5 hours of my life today…
Maybe that place has some sort of virus in it?
luketeam5
(luketeam5)
November 21, 2020, 7:26pm
11
Nope, there aren’t any freemodels everything in that place is made by me and all plugins are off (expect plugins made by me)
luketeam5
(luketeam5)
November 21, 2020, 7:28pm
12
More interesting, when i deleted the entire script and pasted same code into it it worked.