Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't my remote event doing anything?

Asked by
Vulro 0
5 years ago
Edited 5 years ago

This is the only remote event I have that isn't doing anything. I can't figure out what's wrong, It's not printing at all.

Local Script

local Player = game.Players.LocalPlayer
local InviteEvent = workspace.CharacterEvents.InvitePlayerEvent

script.Parent.FocusLost:Connect(function(enterPressed)
for i, v in pairs(game.Players:GetChildren()) do    
 local Player2  = script.Parent.Text
 if enterPressed and Player.Team ~= game.Teams.Rogues and v.Name == Player2 then
  local Player2 = v
  InviteEvent:FireServer(Player2)
  script.Parent.Parent.Sound:Play() 
  print("Invite Sent")
 elseif Player.Team == game.Teams.Rogues then
  script.Parent.Parent.TextLabel.Text = "You need to be in a pack!"
  wait(1)
  script.Parent.Parent.TextLabel.Text = "Invite player to your pack."
  print("Invite Not Sent")
  end
 end
end)

Server Script

script.Parent.OnServerEvent:Connect(function(Player, Player2)
print("I'm confused")
end)
0
did you set InviteEvent to your RemoteEvent earlier? Benbebop 1049 — 5y
0
Forgot to paste that into the post but yes Vulro 0 — 5y
0
try instead of using Workspace to store RemoteEvents use ReplicatedStorage Benbebop 1049 — 5y
0
okay I will thanks Vulro 0 — 4y
0
worked thank you Vulro 0 — 4y

Answer this question