Not entirely sure what is going on here but I get this error.
Players.DevRhy.PlayerGui.ScreenGui.TextButton.Script:15: attempt to index number with 'Character'
my script is:
function part(head)
local X = head.Position.X
local Y = head.Position.Y
local Z = head.Position.Z
local posAboveHead = Vector3.new(X, Y + 5, Z)
local part = Instance.new("Part")
part.Parent = workspace
part.Position = posAboveHead
end
script.Parent.MouseButton1Up:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:wait()
local head = char.Head
part(head)
end)

1 comment
try removing :wait() as it might think that you intend for that to be "char"'s value