Unable to cast value to Object

Hi so I’m making a join party system and Im getting an error

Error

Unable to cast value to Object

Script

local leader = game.ReplicatedStorage.Parties:FindFirstChild(value1).Players:WaitForChild("Party Leader").Value
local requestFrame = game.Players:FindFirstChild(leader).PlayerGui.PartyGui.PartyGuiScript.request:Clone()
requestFrame.Parent = game.Players:FindFirstChild(leader).PlayerGui
game.ReplicatedStorage.join:FireClient(leader, player, value1) --This line

Have you tried looking at other similar errors on the dev forum.

try doing this to find out if the issue is the same as the post above

local leader = game.ReplicatedStorage.Parties:FindFirstChild(value1).Players:WaitForChild("Party Leader").Value
local requestFrame = game.Players:FindFirstChild(leader).PlayerGui.PartyGui.PartyGuiScript.request:Clone()
requestFrame.Parent = game.Players:FindFirstChild(leader).PlayerGui
print(typeof(leader))
game.ReplicatedStorage.join:FireClient(leader, player, value1) --This line
1 Like