Hi I am having a problem with getting a players character
Script
game.ReplicatedStorage.join1.OnServerEvent:Connect(function(plr, joinerName, pName)
local leader = game.ReplicatedStorage.Parties:WaitForChild(pName).Players:WaitForChild("Party Leader").Value
local requestFrame = game.Players:FindFirstChild(leader).PlayerGui.PartyGui.PartyGuiScript.request:Clone()
requestFrame.Parent = game.Players:FindFirstChild(leader).PlayerGui.PartyGui
requestFrame.Partyname.Value = pName
requestFrame.TextLabel.Text = joinerName.Name.." Wants To Join Your Party"
print(joinerName)
local Player = game:GetService("Players"):FindFirstChild(joinerName)
local Character = Player.Character or Player.CharacterAdded:Wait()
local torso = Character:WaitForChild("Torso")
local Humanoid = Character:WaitForChild("Humanoid")
local Head = Character:WaitForChild('Head')
Head.Party.Frame.Rank.Text = pName
game.Players:WaitForChild(joinerName).PlayerGui.PartyGui.PartyGuiFrame.Transparency = 1
game.Players:WaitForChild(joinerName).PlayerGui.PartyGui.PartyGuiFrame.UIStroke.Thickness = 0
print(joinerName.Name.." Wants To Join Your Party ("..pName..")")
end)
Error
ServerScriptService.Script:9: attempt to index nil with 'Character' - Server - Script:9```