local PoBox = game.Workspace.Assets.PostBox31 local Posting = game.Players.LocalPlayer:FindFirstChild("Posting") Posting.Value = false PoBox.ClickDetector.MouseClick:Connect(function(clicked) if Posting.Value == true then game.ReplicatedStorage.AlreadyPosting:FireClient() print("Already posted fired") else game.ReplicatedStorage.PostingStarted:FireClient() print("Fired") end end)
Output:
17:07:25.565 - Workspace.Assets.PostBox31.PostingScript:2: attempt to index nil with 'FindFirstChild'
17:07:25.566 - Stack Begin
17:07:25.566 - Script 'Workspace.Assets.PostBox31.PostingScript', Line 2
17:07:25.567 - Stack End
Using WaitForChild shows the error: 17:18:35.169 - Workspace.Assets.PostBox31.PostingScript:2: attempt to index nil with 'WaitForChild'
Also if that doesnt help then you can also define posting in the mouseclick function
local PoBox = game.Workspace.Assets.PostBox31 PoBox.ClickDetector.MouseClick:Connect(function(clicked) local Posting = game.Players.LocalPlayer.Posting Posting.Value == not Posting.Value if Posting.Value == true then game.ReplicatedStorage.AlreadyPosting:FireClient() print("Already posted fired") else game.ReplicatedStorage.PostingStarted:FireClient() print("Fired") end end)
It is probably because you are not doing it in a local script, so that is why the player is nil, you can access local player with Local Script only.