Hello! I’m having a problem. I’m trying to make it so if a player hits an object, a remote event fires. It works the first time, but I get an error the second time? It looks like the output is saying that the player is nil again. That doesn’t make sense. Here’s the code and the error message. If anyone could help out, that’d be awesome. Thanks!
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
task.wait(1)
if player ~= nil then
print(player.Name.." 1")
game.ReplicatedStorage.CameraEvent4:FireClient(player)
end