Hey! So I have a server script and a local script, local script fires a remote and server receives. Yet, there is a chance when the player joins, that the server script does not receive the remote event. Any help with this? The “fired” from the local script is activated, so that tells me its fired, yet I get no “success” or “failure”, nor do I get any errors.
Server Script:
local rep = game:GetService("ReplicatedStorage")
local check = rep.Requests.GroupCheck
local checkP = rep.Requests.GroupCheckP
local checkD = rep.Requests.GroupCheckD
local attri = script.Parent.AttributeController
print("Initialized")
check.OnServerEvent:Connect(function(player)
if player:GetRankInGroup(16018352) >= 254 then
print("success")
local h = attri:Clone()
h.Parent = player.PlayerGui.ModGUI.Attributes.Main
h.Enabled = true
checkP:FireClient(player)
else
print("failure")
checkD:FireClient(player)
return
end
end)
Local Script:
local rep = game:GetService("ReplicatedStorage").Requests
local event = rep.GroupCheckP
local ohno = rep.GroupCheckD
rep.GroupCheck:FireServer()
print("fired")
local function onohnoFired()
print("LOL LOSER!")
script.Parent:Destroy()
end
local function oneventFired()
print("It works!!!!!")
end
event.OnClientEvent:Connect(oneventFired)
ohno.OnClientEvent:Connect(onohnoFired)
local rep = game:GetService("ReplicatedStorage").Requests
local event = rep.GroupCheckP
local ohno = rep.GroupCheckD
game.Loaded:Wait() -- or wait here using some other method
rep.GroupCheck:FireServer()
print("fired")
local function onohnoFired()
print("LOL LOSER!")
script.Parent:Destroy()
end
local function oneventFired()
print("It works!!!!!")
end
event.OnClientEvent:Connect(oneventFired)
ohno.OnClientEvent:Connect(onohnoFired)
But I can’t seem to replicate your issue, where did you put the scripts?
I’ve added a button to fire the remote, and I realized that when the original script doesn’t work, the button also doesn’t work.
It seems like there’s something wrong with the event itself?