Referencing objects through a script

I want to make a quick check to ensure that when I reference them they are correct and do as intended. But when I try to run in-game I get no output.

local RS = game:GetService("ReplicatedStorage")
local LF = RS.F1
local P = game:GetService("Players")
local LP = P.LocalPlayer

local function F1P(player)
	local leaderstat = LP:WaitForChild("leaderstats")
	local Coin = leaderstat:WaitForChild("Coins")
	
	if leaderstat:FindFirstChild("Coins") then
		print("check")
	end 
end


P.PlayerAdded:Connect(F1P)

I’ve tried different methods such as i,v, and GetChildren() but still no output.

Any suggestions? :wut:

Is this a local script or a normal script?

Im pretty sure you want to do:

local leaderstat = player:WaitForChild("leaderstats")

Are you creating your leaderstats folder in another script?

Yes, sorry for the late response.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.