Hello, actually there aren’t really any errors, it works fine, but it’s not the result I want. I would like that if a player activates the LocalScript, they can be the only one to see the auras of other players without the others seeing their own auras. Here’s an example of what I mean: if there are 3 players, player 1, player 2, and player 3, when player 1 presses Q, they see the aura of player 2 and player 3. However, players 2 and 3 don’t see their own aura or the aura of the player who sees theirs. But if they click Q in their turn, then they will see the aura of the other 2 respective players.
Script that generates auras when players join.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local upperTorso = character:WaitForChild("UpperTorso")
if upperTorso then
local auraModel = game.ReplicatedStorage.Auras:FindFirstChild("ClassicAura")
if auraModel then
local aura = auraModel:Clone()
aura.Enabled = false
aura.Parent = upperTorso
else
warn("Aura model not found.")
end
else
warn("UpperTorso not found for player:", player.Name)
end
end)
end)
The LocalScript
local AuraEvent = game.ReplicatedStorage.AuraEvent
local UserInputService = game:GetService("UserInputService")
local auraVisionActivated = false
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q then
auraVisionActivated = not auraVisionActivated
print("Sending AuraEvent to server, activateAuraVision:", auraVisionActivated)
AuraEvent:FireServer(auraVisionActivated)
end
end)
k
The Script
local AuraEvent = game.ReplicatedStorage.AuraEvent
game.Players.PlayerAdded:Connect(function(player)
AuraEvent.OnServerEvent:Connect(function(senderPlayer, activateAuraVision)
print("Received AuraEvent for player:", senderPlayer.Name, "activateAuraVision:", activateAuraVision)
local senderCharacter = senderPlayer.Character
if senderCharacter then
local upperTorso = senderCharacter:FindFirstChild("UpperTorso")
if upperTorso then
local aura = upperTorso:FindFirstChild("ClassicAura")
if aura then
if activateAuraVision then
print("Activating aura vision for player:", senderPlayer.Name)
aura.Enabled = true
print("Aura activated for player:", senderPlayer.Name)
else
print("Deactivating aura vision for player:", senderPlayer.Name)
aura.Enabled = false
print("Aura deactivated for player:", senderPlayer.Name)
end
else
print("ClassicAura not found for player:", senderPlayer.Name)
end
else
print("UpperTorso not found for player:", senderPlayer.Name)
end
else
print("Character not found for player:", senderPlayer.Name)
end
end)
end)