Hello, I'm trying to make a script where once a player enters the hitbox, they will slow down and then create a ColorCorrection Effect. For the color correction i chose to go with a remote events that fires when a player hits the hitbox.
It kinda works, but i get spammed by errors in the console saying "FireClient: player argument must be a Player object"
The error will still occur even though the other player gets slowed down and gets applied with the color correction.
Any tips on how i could fix this? I'm trying to fire the remote for the enemy player and not my local player.
Part of Server Script
Hitbox.Touched:Connect(function(Hit)
if Hitbox:IsA("BasePart") then
if not Hit:IsDescendantOf(Char) then
local enemy = Hit.Parent
local enemyHumanoid = Hit.Parent:FindFirstChild("Humanoid")
local enemyHumrp = Hit.Parent:FindFirstChild("HumanoidRootPart")
spawn(function()
local enemyPlr = game.Players:GetPlayerFromCharacter(enemy)
LightRemote:FireClient(enemyPlr)
end)

2 comments
Fix your scripts, you're missing 'end' for some scopes.
That is not the issue. This is not the entire script, and i am not missing any end's