The title basically says it all-
I have the player set in the first function but when the second function comes around it’s nil…
I used print arguments to show whether the player is nil through each function.
Oddly, the character seems to stay between each function but the player still becomes nil nonetheless.
local Players = game:GetService("Players")
local player
local character
local backpack
function onPlayerAdded(player)
backpack = player:WaitForChild("Backpack")
character = player.CharacterAdded:Wait()
print(player, "onPlayerAdded")
print(character, "onPlayerAdded")
print(backpack.Parent, "onPlayerAdded")
awawa()
end
function awawa(player)
print(player,"awawa")
print(character,"awawa")
print(backpack.Parent,"awawa")
end
game.Players.PlayerAdded:Connect(onPlayerAdded)
If anyone can possibly help it’d be greatly appreciated