EDIT: I just realized I forgot to do Touched instead of PlayerAdded.. dang.
Hey.
Y'all remember TwoShue's Freeze Tag came from like 2010-2011? Fun stuff. I'm trying to recreate it somewhat, but instead of another humanoid touching another, I'm going simpler and trying to get players frozen by touching a brick. Problem is, every time I run the code, I get:
"Workspace.FreezingPart.Script:10: attempt to index nil with 'FindFirstChild'"
Here's my code for reference:
local PlayersService = game:GetService("Players")
game.Players.PlayerAdded:Connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
local freezePart = Instance.new("Part", workspace)
freezePart.Anchored = true
freezePart.Material = "Neon"
freezePart.CanCollide = false
freezePart.Size = Vector3.new(5, 5.5, 4)
freezePart.CFrame = CFrame.new(plr:FindFirstChild('HumanoidRootPart').Position)
freezePart.Parent = plr
end)
How can I remediate the error? I've tried messing about with a local character, a local player's position, etc., but I'm struggling. I know the script isn't finished yet: I haven't altered the player's anchoring, transparency, etc. after he touches the brick, but I really just want the brick to appear at his/her location first, above all else. Any help would be appreciated. Thank you in advance.

2 comments
Your trying to get a player from a player. Replace line 3 with "game.Players.PlayerAdded:Connect(function(plr)", delete line 5, and delete line 1. You should have a working script
Thank you bro!