So I have a script that basically gets the name of the player that hit an object:
script.Parent.Touched:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
local Name = player.Name
game.ReplicatedStorage.Eliminated:FireServer(Name)
end)
The name then gets sent to a remote event that sends in which a script recieves that information:
that means player is nil, make sure when you get player, you make sure what touched it is a character, so try something like this
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChildOfClass("Humanoid") then
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
local Name = player.Name
game.ReplicatedStorage.Eliminated:FireServer(Name)
end
end)
is the remove event still firing? to test you can do something like this,
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChildOfClass("Humanoid") then
print("touched by a character")
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
local Name = player.Name
game.ReplicatedStorage.Eliminated:FireServer(Name)
else
print("something other than a character touched it")
end
end)