First off, NO, I am NOT having issues with starting the game. It’s not that. I’m trying to simply detect when the character gets added and it’s not firing.
The code sample provided is in a local script:
function _G:BindPlayer(plr : Player | nil, inst, doNotBindChar)
if plr ~= nil then
local playerLeaveFunc = nil
local playerCharAddedFunc = nil
playerLeaveFunc = game:GetService("Players").PlayerRemoving:Connect(function(plrLeave)
if plrLeave == plr then
inst:Destroy()
playerLeaveFunc:Disconnect()
plr = nil
playerLeaveFunc = nil
playerCharAddedFunc:Disconnect()
playerCharAddedFunc = nil
end
end)
playerCharAddedFunc = plr.CharacterAdded:Connect(function()
print('character added')
print(doNotBindChar ~= true)
if doNotBindChar ~= true then
print('character added 2')
inst:Destroy()
playerLeaveFunc:Disconnect()
plr = nil
playerLeaveFunc = nil
playerCharAddedFunc:Disconnect()
playerCharAddedFunc = nil
end
end)
end
end
Second off, NO, other topics, that I could find, are not helping me because it’s bloated by people who had issue with first spawns.
What I’ve tested so far:
Does the connection get made? Yes.
Does the function work by itself? Yes.
Is the Player nil? No.
Does running the function in the command bar work? Yes.
This script is not located within the character, therefore this proposal isn’t relevant.
But to answer your question: Reseting yields the same result, it doesn’t work.
And, like I mentioned above, my issue isn’t related to first spawns or the character already being created. The event is just simply not firing when the character is added.