Have a function that Fires a bindable event. Which you can see below.
PrivateLeave1.OnServerEvent:Connect(function(player)
local String = player.Name
local PlayerTeam = PPlayerTeam1
local PPlayer1 = PP1Player1
local PPlayer2 = PP1Player2
local PPlayer3 = PP1Player3
local PPlayer4 = PP1Player4
player.Team = NoParty
for i, name in pairs(PPlayerTeam1) do
if name == String then
table.remove(PPlayerTeam1, i)
if i == 1 then
PP1Player1.Value = "Player 1"
PP1Player2.Value = "Player 2"
PP1Player3.Value = "Player 3"
PP1Player4.Value = "Player 4"
GuiReset:Fire(PlayerTeam, PPlayer1, PPlayer2, PPlayer3, PPlayer4) --bindable event
break
end
end
end
end)
This Bindable Event works with multiple functions which is the purpose for the local variables below.
To pass different team values which includes the players.
There is nothing wrong with the code above, I moved this function into the same script for the function for the bindableevent (GuiReset). Both scripts are Server Scripts.
I thought bindable events are supposed to work with separate server scripts?
Error I get is "attempt to index function with āFireā
Whatās the reason for this error and what is it saying?