I don't know why this script won't work?
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local PlayerName = hit.Parent.Name
--Player One--
local Gui = script.Parent.Parent.PlayersInMatchPart.PlayersInMatchGui
if Gui.Player1.Taken.Value == 1 and Gui.Player1.Name.Value ~= PlayerName then
Gui.Player1.Taken.Value = 2
print(PlayerName.userId)
Gui.Player1.Name.Value = PlayerName
end
end
end)
end)
Error: Workspace.MatchMakingArea.MatchFinderPart.OnTouch:8: attempt to index field 'Name' (a string value)
Also when I print our the players Id it just says nil?
