Hey! I have been wondering, how could I enter two player values into a RemoteEvent fire, if both of them are “local”? Let me give you more context, so that I explain what I mean.
I have a variable for the LocalPlayer:
local Players = game:GetService("Players")
local player = Players.LocalPlayer
If the player’s property Team gets changed, a function will get fired:
player:GetPropertyChangedSignal("Team"):Connect(function()
end)
Now in the function, there is a RemoteEvent, which gets fired alongside a local function (the local function is pointless to know for now, as it’s just for making a GUI visible/invisible, and it works)
player:GetPropertyChangedSignal("Team"):Connect(function()
spectateButton()
SpectateEvent:FireServer()
end)
In the ServerScript, which handles the SpectateEvent RemoteEvent, it looks like this:
SpectateEvent.OnServerEvent:Connect(function(targetPlayer)
end)
targetPlayer returns the player, whose Team property got changed. However, I also want to add a value for the LOCAL player, meaning every player in the server, on their own each client-side.
Problem is, that if I make (player, targetPlayer), it’s not gonna help and basically be just two same values. What causes this is that the GetPropertyChangedSignal function is checked on the LocalPlayer (in the LocalScript), meaning that it’s basically two same values.
I don’t know how to fix this issue.
TL;DR: I need to fire two “local” values. One for the LocalPlayer itself, and another one for a player whose Team property gets changed (both in the same LocalScript). I’m not sure if this can be fixed by some loop instead of the GetPropertyChangedSignal function, or something like that. That’s why I’d like to get help.